Skip to content

Instantly share code, notes, and snippets.

@johnthethird
Created March 2, 2010 19:35
Show Gist options
  • Select an option

  • Save johnthethird/319826 to your computer and use it in GitHub Desktop.

Select an option

Save johnthethird/319826 to your computer and use it in GitHub Desktop.
client = Riak::Client.new()
bucket = client.bucket('MyBucket')
my_json_obj = bucket.get('MyKey')
my_json_obj.content_type #=> "application/json"
my_json_obj.data.to_json #=> {"name":=>"Joe"}
my_json_obj.data.to_s #=> nameJoe
Should RObject.data.to_s be aliased to .to_json when we know the content_type is json?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment