Module: MultiJson::Adapters::JsonCommon

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

Instance Method Summary collapse

Instance Method Details

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


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

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

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


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

def load(string, options={})
  string = string.read if string.respond_to?(:read)
  ::JSON.parse("[#{string}]", process_load_options!(options)).first
end