Class: Date

Inherits:
Object
  • Object
show all
Defined in:
lib/utopia/extensions/date.rb

Instance Method Summary collapse

Instance Method Details

#<=>(other) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/utopia/extensions/date.rb', line 10

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_cmpObject



8
# File 'lib/utopia/extensions/date.rb', line 8

alias_method :old_cmp, :<=>