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

<=>

        # DateTime.<=>

(from ruby core)
---
    d <=> other  -> -1, 0, +1 or nil

---

Compares the two dates and returns -1, zero, 1 or nil.  The other should
be a date object or a numeric value as an astronomical Julian day
number.

    Date.new(2001,2,3) <=> Date.new(2001,2,4)   #=> -1
    Date.new(2001,2,3) <=> Date.new(2001,2,3)   #=> 0
    Date.new(2001,2,3) <=> Date.new(2001,2,2)   #=> 1
    Date.new(2001,2,3) <=> Object.new           #=> nil
    Date.new(2001,2,3) <=> Rational(4903887,2)  #=> 0

See also Comparable.


(from ruby core)
### Implementation from Object
---
    obj <=> other -> 0 or nil

---

Returns 0 if `obj` and `other` are the same object or `obj == other`,
otherwise nil.

The #<=> is used by various methods to compare objects, for example
Enumerable#sort, Enumerable#max etc.

Your implementation of #<=> should return one of the following values:
-1, 0, 1 or nil. -1 means self is smaller than other. 0 means self is
equal to other. 1 means self is bigger than other. Nil means the two
values could not be compared.

When you define #<=>, you can include Comparable to gain the methods
#<=, #<, #==, #>=, #> and #between?.



      

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.