Method: MultiJson.load

Defined in:
lib/multi_json.rb

.load(string, options = {}) ⇒ Object Also known as: decode

Decode a JSON string into Ruby.

Options

:symbolize_keys

If true, will use symbols instead of strings for the keys.

:adapter

If set, the selected engine will be used just for the call.



93
94
95
96
97
98
99
100
# File 'lib/multi_json.rb', line 93

def load(string, options={})
  adapter = current_adapter(options)
  begin
    adapter.load(string, options)
  rescue adapter::ParseError => exception
    raise DecodeError.new(exception.message, exception.backtrace, string)
  end
end