Skip to content
instance method

NilClass#to_r

() -> ::Rational
to_r → (0/1)

Returns zero as a Rational:

Example
nil.to_r # => (0/1)
See also #to_i #to_s #to_h also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0