Module: Locomotive::RelationalAlgebra::ConstAttribute::HashKeys

Included in:
Locomotive::RelationalAlgebra::ConstAttribute
Defined in:
lib/locomotive/relational_algebra/attributes.rb

Instance Method Summary collapse

Instance Method Details

#eql?(other) ⇒ Boolean

We want to use attributes as keys for a hash-object, so we have to overwrite the eql?- and hash-method to make it work

Returns:

  • (Boolean)


58
59
60
# File 'lib/locomotive/relational_algebra/attributes.rb', line 58

def eql?(other)
  self.==(other)
end

#hashObject



63
64
65
66
67
# File 'lib/locomotive/relational_algebra/attributes.rb', line 63

def hash
  # not the best algorithm for calculating a
  # hash but it works quite well
  self.class.object_id + id.object_id
end