Class: Oj::MimicDumpOption
- Inherits:
-
Hash
- Object
- Hash
- Oj::MimicDumpOption
- Defined in:
- lib/oj/mimic.rb
Overview
A bit hack-ish but does the trick. The JSON.dump_default_options is a Hash but in mimic we use a C struct to store defaults. This class creates a view onto that struct.
Instance Method Summary collapse
- #[]=(key, value) ⇒ Object
-
#initialize ⇒ MimicDumpOption
constructor
A new instance of MimicDumpOption.
Constructor Details
#initialize ⇒ MimicDumpOption
Returns a new instance of MimicDumpOption.
58 59 60 61 62 63 64 65 66 |
# File 'lib/oj/mimic.rb', line 58 def initialize() oo = Oj. self.store(:max_nesting, false) self.store(:allow_nan, true) self.store(:quirks_mode, oo[:quirks_mode]) self.store(:ascii_only, (:ascii == oo[:escape_mode])) super end |