Module: MultiJson::Adapters::JsonCommon

Included in:
JsonGem, JsonPure
Defined in:
lib/multi_json/adapters/json_common.rb

Instance Method Summary collapse

Instance Method Details

#dump(object, options = {}) ⇒ Object


10
11
12
# File 'lib/multi_json/adapters/json_common.rb', line 10

def dump(object, options={})
  object.to_json(process_options(options))
end

#load(string, options = {}) ⇒ Object


5
6
7
8
# File 'lib/multi_json/adapters/json_common.rb', line 5

def load(string, options={})
  string = string.read if string.respond_to?(:read)
  ::JSON.parse(string, :symbolize_names => options[:symbolize_keys])
end