module Riak::JSON

JSON module for internal use inside riak-client

Public Class Methods

dump(obj)
Alias for: encode
encode(obj) click to toggle source

Generate a JSON string @param [Array, Hash] obj an object to JSON-encode @return [String] a JSON payload

# File lib/riak/json.rb, line 31
def encode(obj)
  MultiJson.dump(obj)
end
Also aliased as: dump
parse(str) click to toggle source

Parse a JSON string @param [String] str a JSON payload @return [Array,Hash] a Ruby object decoded from the JSON payload

# File lib/riak/json.rb, line 24
def parse(str)
  MultiJson.load(str, Riak.json_options)
end