class Mail::Message

def <=>(other)

[mail2, mail1].sort #=> [mail2, mail1]
end
date(Time.now - 86400) # 1 day older
mail2 = Mail.new do
end
date(Time.now)
mail1 = Mail.new do

Example:

email that is older than another will appear first.
Compares this mail object with another mail object, this is done by date, so an

Provides the operator needed for sort et al.
def <=>(other)
  if other.nil?
    1
  else
    self.date <=> other.date
  end
end