Module: Toy::Equality

Extended by:
ActiveSupport::Concern
Included in:
Object
Defined in:
lib/toy/equality.rb

Instance Method Summary collapse

Instance Method Details

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

Returns:



5
6
7
# File 'lib/toy/equality.rb', line 5

def eql?(other)
  self.class.eql?(other.class) && attributes == other.attributes
end

#hashObject



10
11
12
# File 'lib/toy/equality.rb', line 10

def hash
  attributes.hash
end