module JSON::TruffleRuby::Generator::GeneratorMethods::Object
Public Instance Methods
Source
# File lib/json/truffle_ruby/generator.rb, line 406 def to_json(state = nil, *) if state && State.from_state(state).strict? raise GeneratorError.new("#{self.class} not allowed in JSON", self) else to_s.to_json end end
Converts this object to a string (calling to_s), converts it to a JSON
string, and returns the result. This is a fallback, if no special method to_json
was defined for some object.