= private = protected
to_s()
Returns a string representation of the rational number.
Example:
Rational(3,4).to_s # "3/4" Rational(8).to_s # "8"
# File lib/rational.rb, line 368 def to_s if @denominator == 1 @numerator.to_s else @numerator.to_s+"/"+@denominator.to_s end end