End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Psych::Visitors::YAMLTree#visit_Float
visit_Float(o)
ext/psych/lib/psych/visitors/yaml_tree.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/ext/psych/lib/psych/visitors/yaml_tree.rb, line 240
def visit_Float o
if o.nan?
@emitter.scalar '.nan', nil, nil, true, false, Nodes::Scalar::ANY
elsif o.infinite?
@emitter.scalar((o.infinite? > 0 ? '.inf' : '-.inf'),
nil, nil, true, false, Nodes::Scalar::ANY)
else
@emitter.scalar o.to_s, nil, nil, true, false, Nodes::Scalar::ANY
end
end
No documentation available
See also
#visit_FalseClass
#visit_Hash
#visit_Exception
#visit_hash_subclass
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1