Module: MultiJson::Engines::JsonCommon
- Defined in:
- lib/json-schema/lib/multi_json/multi_json/engines/json_common.rb
Instance Method Summary collapse
Instance Method Details
#decode(string, options = {}) ⇒ Object
5 6 7 8 9 10 |
# File 'lib/json-schema/lib/multi_json/multi_json/engines/json_common.rb', line 5 def decode(string, = {}) opts = {} opts[:symbolize_names] = [:symbolize_keys] string = string.read if string.respond_to?(:read) ::JSON.parse(string, opts) end |
#encode(object, options = {}) ⇒ Object
12 13 14 |
# File 'lib/json-schema/lib/multi_json/multi_json/engines/json_common.rb', line 12 def encode(object, = {}) object.to_json(()) end |