Class: Date
- Inherits:
-
Object
- Object
- Date
- Defined in:
- lib/utopia/extensions.rb
Instance Method Summary collapse
Instance Method Details
#<=>(other) ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/utopia/extensions.rb', line 21 def <=> (other) # Comparing a Date with something that has a time component truncates the time # component, thus we need to check if the other object has a more exact comparison # function. if other.respond_to?(:hour) return (other <=> self) * -1 else old_cmp(other) end end |
#old_cmp ⇒ Object
19 |
# File 'lib/utopia/extensions.rb', line 19 alias_method :old_cmp, :<=> |