Class: RapidJSON::Coder
- Inherits:
-
Object
- Object
- RapidJSON::Coder
- Defined in:
- lib/rapidjson.rb
Instance Method Summary collapse
- #dump(object) ⇒ Object
-
#initialize(pretty: false, allow_nan: false, &to_json) ⇒ Coder
constructor
A new instance of Coder.
- #load(string) ⇒ Object
Constructor Details
#initialize(pretty: false, allow_nan: false, &to_json) ⇒ Coder
Returns a new instance of Coder.
11 12 13 14 15 |
# File 'lib/rapidjson.rb', line 11 def initialize(pretty: false, allow_nan: false, &to_json) @pretty = pretty @to_json_proc = to_json @allow_nan = allow_nan end |
Instance Method Details
#dump(object) ⇒ Object
17 18 19 |
# File 'lib/rapidjson.rb', line 17 def dump(object) _dump(object, @pretty, @to_json_proc, @allow_nan) end |
#load(string) ⇒ Object
21 22 23 |
# File 'lib/rapidjson.rb', line 21 def load(string) _load(string, @allow_nan) end |