Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
require 'ripple'
# Create a client interface
client =
# Retrieve a bucket
bucket = client.bucket("doc") # a Riak::Bucket
new_one =, "application.js")
new_one.content_type = "application/javascript" # You must set the content type. = "alert('Hello, World!')"
# Get an object from the bucket
object = bucket.get("application.js") # a Riak::RObject
puts object.inspect
class Email
include Ripple::Document
property :from, String, :presence => true
property :to, String, :presence => true
property :sent, Time, :default => proc { }
property :body, String
email = Email.find("37458abc752f8413e") # GET /raw/emails/37458abc752f8413e
email.from = "" # PUT /raw/emails/37458abc752f8413e
reply =
reply.from = "" = ""
reply.body = "Riak is a good fit for scalable Ruby apps."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.