In Files

  • yaml/rubytypes.rb

Parent

Methods

Float

Public Instance Methods

to_yaml( opts = {} ) click to toggle source
 
               # File yaml/rubytypes.rb, line 366
def to_yaml( opts = {} )
        YAML::quick_emit( nil, opts ) do |out|
    str = self.to_s
    if str == "Infinity"
        str = ".Inf"
    elsif str == "-Infinity"
        str = "-.Inf"
    elsif str == "NaN"
        str = ".NaN"
    end
    out.scalar( "tag:yaml.org,2002:float", str, :plain )
end
end