Class: Time
Instance Method Summary collapse
Instance Method Details
#<=>(other) ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/utopia/extensions/date.rb', line 36 def <=>(other) if other.class == Date (other <=> self) * -1 elsif Time === other old_compare(other) else if DateTime === other other = other.to_time end old_compare(other) end end |
#old_compare ⇒ Object
34 |
# File 'lib/utopia/extensions/date.rb', line 34 alias_method :old_compare, :<=> |