Class: MultiJson::Adapters::Oj
- Inherits:
-
MultiJson::Adapter
- Object
- MultiJson::Adapter
- MultiJson::Adapters::Oj
- Defined in:
- lib/multi_json/adapters/oj.rb
Overview
Use the Oj library to dump/load.
Constant Summary collapse
- ParseError =
defined?(::Oj::ParseError) ? ::Oj::ParseError : SyntaxError
Instance Attribute Summary
Attributes included from Options
Instance Method Summary collapse
Methods inherited from MultiJson::Adapter
activate!, defaults, dump, load
Methods included from Options
#default_dump_options, #default_load_options
Instance Method Details
#dump(object, options = {}) ⇒ Object
18 19 20 21 |
# File 'lib/multi_json/adapters/oj.rb', line 18 def dump(object, ={}) .merge!(:indent => 2) if [:pretty] ::Oj.dump(object, ) end |
#load(string, options = {}) ⇒ Object
13 14 15 16 |
# File 'lib/multi_json/adapters/oj.rb', line 13 def load(string, ={}) [:symbol_keys] = .delete(:symbolize_keys) ::Oj.load(string, ) end |