class JSON::TruffleRuby::Generator::State

def generate(obj)

GeneratorError exception.
created this method raises a
returns the result. If no valid JSON document can be
Generates a valid JSON document from object +obj+ and
def generate(obj)
  if @indent.empty? and @space.empty? and @space_before.empty? and @object_nl.empty? and @array_nl.empty? and
      !@ascii_only and !@script_safe and @max_nesting == 0 and !@strict
    result = generate_json(obj, ''.dup)
  else
    result = obj.to_json(self)
  end
  JSON::TruffleRuby::Generator.valid_utf8?(result) or raise GeneratorError,
    "source sequence #{result.inspect} is illegal/malformed utf-8"
  result
end