Class | JSON::State
In: | lib/facets/more/json.rb
Parent: | Object

This class is used to create State instances, that are use to hold data while unparsing a Ruby data structure into a JSON string.

### Methods

forget from_state new remember seen?

### Attributes

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.

### Public Class methods

from_state(opts)

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.

new(opts = {})

Instantiates a new State object, configured by opts.

### Public Instance methods

forget(object)

Forget object for this Unparsing run.

remember(object)

Remember object, to find out if it was already encountered (to find out if a cyclic data structure is unparsed).

seen?(object)

Returns true, if object was already seen during this Unparsing run.

[Validate]