Class: Hash
Instance Method Summary collapse
-
#to_json(state = nil, depth = 0) ⇒ Object
Returns a JSON string containing a JSON object, that is unparsed from this Hash instance.
Instance Method Details
#to_json(state = nil, depth = 0) ⇒ Object
Returns a JSON string containing a JSON object, that is unparsed from this Hash 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.
515 516 517 518 |
# File 'lib/facets/json.rb', line 515 def to_json(state = nil, depth = 0) state = JSON::State.from_state(state) json_check_circular(state) { json_transform(state, depth) } end |