Module: Utopia::Extensions::TimeDateComparison
- Defined in:
- lib/utopia/extensions/date_comparisons.rb
Overview
Provides comparison operator extensions.
Instance Method Summary collapse
-
#<=>(other) ⇒ Object
Compare a time with a date-like or otherwise comparable value.
Instance Method Details
#<=>(other) ⇒ Object
Compare a time with a date-like or otherwise comparable value.
15 16 17 18 19 20 21 |
# File 'lib/utopia/extensions/date_comparisons.rb', line 15 def <=>(other) if Date === other or DateTime === other self.to_datetime <=> other else super end end |