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 386 386: def self.from_state(opts) 387: case opts 388: when self 389: opts 390: when Hash 391: new(opts) 392: else 393: new 394: end 395: end
Forget object for this Unparsing run.
# File lib/json.rb, line 432 432: def forget(object) 433: @seen.delete object.__id__ 434: 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 427 427: def remember(object) 428: @seen[object.__id__] = true 429: end