method

to_r

ruby latest stable - Class: Rational
to_r()
public

Returns self.

Rational(2).to_r      #=> (2/1)
Rational(-8, 6).to_r  #=> (-4/3)