Class | JSON::Pure::Generator::State |
In: |
lib/json/pure/generator.rb
|
Parent: | Object |
array_nl | [RW] | This string is put at the end of a line that holds a JSON array. |
depth | [RW] | This integer returns the current depth data structure nesting in the generated JSON. |
indent | [RW] | This string is used to indent levels in the JSON text. |
max_nesting | [RW] | This integer returns the maximum level of data structure nesting in the generated JSON, max_nesting = 0 if no maximum is checked. |
object_nl | [RW] | This string is put at the end of a line that holds a JSON object (or Hash). |
quirks_mode | [RW] | If this attribute is set to true, quirks mode is enabled, otherwise it‘s disabled. |
space | [RW] | This string is used to insert a space between the tokens in a JSON string. |
space_before | [RW] | This string is used to insert a space before the ’:’ in JSON objects. |
Instantiates a new State object, configured by opts.
opts can have the following keys:
Returns true if NaN, Infinity, and -Infinity should be considered as valid JSON and output.
Generates a valid JSON document from object obj and returns the result. If no valid JSON document can be created this method raises a GeneratorError exception.
Returns the configuration instance variables as a hash, that can be passed to the configure method.