class MultiJson::Adapters::Gson

Use the gson.rb library to dump/load.

def dump(object, options = {})

Other tags:
    Example: Serialize object to JSON -

Returns:
  • (String) - JSON string

Parameters:
  • options (Hash) -- serialization options
  • object (Object) -- object to serialize

Other tags:
    Api: - private
def dump(object, options = {})
  ::Gson::Encoder.new(options).encode(object)
end

def load(string, options = {})

Other tags:
    Example: Parse JSON string -

Returns:
  • (Object) - parsed Ruby object

Parameters:
  • options (Hash) -- parsing options
  • string (String) -- JSON string to parse

Other tags:
    Api: - private
def load(string, options = {})
  ::Gson::Decoder.new(options).decode(string)
end