Class: Float

Inherits:
Object show all
Defined in:
lib/yaml/rubytypes.rb

Instance Method Summary collapse

Instance Method Details

#to_yaml(opts = {}) ⇒ Object



367
368
369
370
371
372
373
374
375
376
377
378
379
# File 'lib/yaml/rubytypes.rb', line 367

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