Class | JSON::State |
In: |
lib/json.rb
|
Parent: | Object |
array_nl | [RW] | This string is put at the end of a line that holds a JSON array. |
indent | [RW] | This string is used to indent levels in the JSON string. |
object_nl | [RW] | This string is put at the end of a line that holds a JSON object (or Hash). |
space | [RW] | This string is used to include a space between the tokens in a JSON string. |
Creates a State object from opts, which ought to be Hash to create a new State instance configured by opts, something else to create an unconfigured instance. If opts is a State object, it is just returned.
# File lib/json.rb, line 331 331: def self.from_state(opts) 332: case opts 333: when self 334: opts 335: when Hash 336: new(opts) 337: else 338: new 339: end 340: end
Forget object for this Unparsing run.
# File lib/json.rb, line 377 377: def forget(object) 378: @seen.delete object.__id__ 379: end
Remember object, to find out if it was already encountered (to find out if a cyclic data structure is unparsed).
# File lib/json.rb, line 372 372: def remember(object) 373: @seen[object.__id__] = true 374: end