module DateTimeComparison
Provides comparison operator extensions.
Definitions
def <=>(other)
Compare a date with a time or otherwise comparable value.
Signature
-
parameter
otherObject The object to compare.
-
returns
Integer | Nil The comparison result.
Implementation
def <=>(other)
if Time === other
self.to_datetime <=> other.to_datetime
else
super
end
end