Possible duplicate:
Ruby syntax question: Rational (a, b) and Rational.new! (a, b)
I am in the process of reading a ruby ββpickaxe, and I am confused by the syntax of creating rational numbers.
Rational(3,4) * Rational(1,2)
produces
=> 3/8
Why is the method newnot needed for Rational(I also noticed, for example, I can create a string without a new method)?
source
share