Class: MultiJson::Adapters::Oj
- Inherits:
-
Object
- Object
- MultiJson::Adapters::Oj
- Defined in:
- lib/multi_json/adapters/oj.rb
Overview
Use the Oj library to dump/load.
Constant Summary collapse
- ParseError =
if defined?(::Oj::ParseError) ::Oj::ParseError else SyntaxError end
Class Method Summary collapse
-
.dump(object, options = {}) ⇒ Object
:nodoc:.
-
.load(string, options = {}) ⇒ Object
:nodoc:.
Class Method Details
.dump(object, options = {}) ⇒ Object
:nodoc:
20 21 22 23 |
# File 'lib/multi_json/adapters/oj.rb', line 20 def self.dump(object, ={}) #:nodoc: .merge!(:indent => 2) if [:pretty] ::Oj.dump(object, ) end |
.load(string, options = {}) ⇒ Object
:nodoc:
15 16 17 18 |
# File 'lib/multi_json/adapters/oj.rb', line 15 def self.load(string, ={}) #:nodoc: .merge!(:symbol_keys => [:symbolize_keys]) ::Oj.load(string, ) end |