Class: MultiJson::Adapters::FastJsonparser
- Inherits:
-
MultiJson::Adapter
- Object
- MultiJson::Adapter
- MultiJson::Adapters::FastJsonparser
- Includes:
- OjCommon
- Defined in:
- lib/multi_json/adapters/fast_jsonparser.rb
Overview
Use the FastJsonparser library to load and Oj to dump.
Constant Summary collapse
- ParseError =
::FastJsonparser::ParseError
Instance Method Summary collapse
-
#dump(object, options = {}) ⇒ String
private
Serialize a Ruby object to JSON.
-
#load(string, options = {}) ⇒ Object
private
Parse a JSON string into a Ruby object.
Methods inherited from MultiJson::Adapter
defaults, dump, inherited, load
Methods included from Options
#default_dump_options, #default_load_options, #dump_options, #dump_options=, #load_options, #load_options=
Instance Method Details
#dump(object, options = {}) ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Serialize a Ruby object to JSON
39 40 41 |
# File 'lib/multi_json/adapters/fast_jsonparser.rb', line 39 def dump(object, = {}) ::Oj.dump(object, ()) end |
#load(string, options = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Parse a JSON string into a Ruby object
26 27 28 |
# File 'lib/multi_json/adapters/fast_jsonparser.rb', line 26 def load(string, = {}) ::FastJsonparser.parse(string, symbolize_keys: [:symbolize_keys]) end |