Class: DateTime
Instance Method Summary collapse
Instance Method Details
#<=>(other) ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/utopia/extensions/date.rb', line 54 def <=>(other) if other.class == Date (other <=> self) * -1 elsif DateTime === other old_compare(other) else if Time === other other = other.to_datetime end old_compare(other) end end |
#old_compare ⇒ Object
52 |
# File 'lib/utopia/extensions/date.rb', line 52 alias_method :old_compare, :<=> |