to_json (JSON::Pure::Generator::GeneratorMethods::Float)

         # File lib/json/pure/generator.rb, line 316
    316:           def to_json(state = nil, *)
    317:             case
    318:             when infinite?
    319:               if !state || state.allow_nan?
    320:                 to_s
    321:               else
    322:                 raise GeneratorError, "#{self} not allowed in JSON"
    323:               end
    324:             when nan?
    325:               if !state || state.allow_nan?
    326:                 to_s
    327:               else
    328:                 raise GeneratorError, "#{self} not allowed in JSON"
    329:               end
    330:             else
    331:               to_s
    332:             end
    333:           end