Class: EivuFingerprinterAcoustid::Objects::BaseClass

Inherits:
Object
  • Object
show all
Defined in:
lib/eivu_fingerprinter_acoustid/objects/base_class.rb

Direct Known Subclasses

Artist, Recording, ReleaseGroup, Result

Instance Method Summary collapse

Instance Method Details

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



7
8
9
# File 'lib/eivu_fingerprinter_acoustid/objects/base_class.rb', line 7

def ==(other)
  other.class == self.class && other&.id == id
end

#hashObject



11
12
13
# File 'lib/eivu_fingerprinter_acoustid/objects/base_class.rb', line 11

def hash
  state.hash
end

#stateObject



15
16
17
# File 'lib/eivu_fingerprinter_acoustid/objects/base_class.rb', line 15

def state
  instance_variables.map { |variable| instance_variable_get variable }
end