Module: Logica::ComparableByState

Included in:
Predicates::Base
Defined in:
lib/logica/comparable_by_state.rb

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



3
4
5
# File 'lib/logica/comparable_by_state.rb', line 3

def ==(other)
  other.instance_of?(self.class) && other.state == state
end

#hashObject



8
9
10
# File 'lib/logica/comparable_by_state.rb', line 8

def hash
  state.hash
end

#stateObject



12
13
14
# File 'lib/logica/comparable_by_state.rb', line 12

def state
  attributes
end