Module: Domain::Comparisons

Defined in:
lib/domain/support/comparisons.rb

Instance Method Summary collapse

Instance Method Details

#<(other) ⇒ Object



12
13
14
# File 'lib/domain/support/comparisons.rb', line 12

def <(other)
  (x = (self <=> other)) && (x < 0)
end

#<=(other) ⇒ Object



16
17
18
# File 'lib/domain/support/comparisons.rb', line 16

def <=(other)
  (x = (self <=> other)) && (x <= 0)
end

#>(other) ⇒ Object



4
5
6
# File 'lib/domain/support/comparisons.rb', line 4

def >(other)
  (x = (self <=> other)) && (x > 0)
end

#>=(other) ⇒ Object



8
9
10
# File 'lib/domain/support/comparisons.rb', line 8

def >=(other)
  (x = (self <=> other)) && (x >= 0)
end