# module PSON::Pure::Generator::GeneratorMethods::Float

### Public Instance Methods

to_pson(state = nil, *) click to toggle source

Returns a PSON string representation for this Float number.

    # File lib/puppet/external/pson/pure/generator.rb, line 323
    def to_pson(state = nil, *)
      case
      when infinite?
        if !state || state.allow_nan?
          to_s
        else
          raise GeneratorError, "#{self} not allowed in PSON"
        end
      when nan?
        if !state || state.allow_nan?
          to_s
        else
          raise GeneratorError, "#{self} not allowed in PSON"
        end
      else
        to_s
      end
    end