This is a Ruby tree! It shows every object from the Ruby Programming Language in a tree format.

rationalize

        # Complex.rationalize

(from ruby core)
---
    cmp.rationalize([eps])  ->  rational

---

Returns the value as a rational if possible (the imaginary part should
be exactly zero).

    Complex(1.0/3, 0).rationalize  #=> (1/3)
    Complex(1, 0.0).rationalize    # RangeError
    Complex(1, 2).rationalize      # RangeError

See to_r.



      

This is MURDOC! A Ruby documentation browser inspired by Smalltalk-80. It allows you to learn about Ruby by browsing through its class hierarchies, and see any of its methods.