Class: Array

Inherits:
Object show all
Defined in:
lib/facets/json.rb

Instance Method Summary collapse

Instance Method Details

#to_json(state = nil, depth = 0) ⇒ Object

Returns a JSON string containing a JSON array, that is unparsed from this Array instance. state is a JSON::State object, that can also be used to configure the produced JSON string output further. depth is used to find out nesting depth, to indent accordingly.



561
562
563
564
# File 'lib/facets/json.rb', line 561

def to_json(state = nil, depth = 0)
  state = JSON::State.from_state(state)
  json_check_circular(state) { json_transform(state, depth) }
end