Class: Float

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

Instance Method Summary collapse

Instance Method Details

#to_yaml(opts = {}) ⇒ Object



371
372
373
374
375
376
377
378
379
380
381
382
383
# File 'lib/syck/rubytypes.rb', line 371

def to_yaml( opts = {} )
	Syck::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