Skip to content

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

JSON::Ext::Generator::State#generate

generate(obj) → String
generate(obj, anIO) → anIO

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.

See also .generate #_generate #indent #escape_slash? also in 4.1 · 4.0 · 3.3 · 3.2 · 3.1 · 3.0