method
coerce
v1_8_7_330 -
Show latest stable
- Class:
Rational
coerce(other)public
No documentation available.
# File lib/rational.rb, line 333
def coerce(other)
if other.kind_of?(Float)
return other, self.to_f
elsif other.kind_of?(Integer)
return Rational.new!(other, 1), self
else
super
end
end