Skip to content
instance method

Rational#inspect

() -> ::String
rat.inspect → string

Returns the value as a string for inspection.

Example
Rational(2).inspect      #=> "(2/1)"
Rational(-8, 6).inspect  #=> "(-4/3)"
Rational('1/2').inspect  #=> "(1/2)"
See also #hash #magnitude #floor #negative? also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0