class Rational # calculates the reciprocal of the rational number #-- # Would be better if wrote reciprocal! method instead def reciprocal 1 / self end end