module JSON::TruffleRuby::Generator::GeneratorMethods::Float
Public Instance Methods
Source
# File lib/json/truffle_ruby/generator.rb, line 534 def to_json(state = nil, *) state = State.from_state(state) case when infinite? if state.allow_nan? to_s else raise GeneratorError.new("#{self} not allowed in JSON", self) end when nan? if state.allow_nan? to_s else raise GeneratorError.new("#{self} not allowed in JSON", self) end else to_s end end