Skip to content
instance method

JSON#fast_generate

(::_ToJson obj, ?::JSON::options opts) -> ::String
JSON.fast_generate(obj, opts) → new_string

Arguments obj and opts here are the same as arguments obj and opts in JSON.generate.

By default, generates JSON data without checking for circular references in obj (option max_nesting set to false, disabled).

Raises an exception if obj contains circular references:

Example
a = []; b = []; a.push(b); b.push(a)
# Raises SystemStackError (stack level too deep):
JSON.fast_generate(a)
See also #dump #generate .on_mixed_keys_hash #load also in 3.4 · 3.3 · 3.2 · 3.1 · 3.0