Module: Riak::JSON

Defined in:
lib/riak/json.rb

Overview

JSON module for internal use inside riak-client

Instance Method Summary collapse

Instance Method Details

#encode(obj) ⇒ String

Generate a JSON string


31
32
33
# File 'lib/riak/json.rb', line 31

def encode(obj)
  MultiJson.dump(obj)
end

#parse(str) ⇒ Array, Hash

Parse a JSON string


24
25
26
# File 'lib/riak/json.rb', line 24

def parse(str)
  MultiJson.load(str, Riak.json_options)
end