Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/MusicMaster/Hash.rb

Instance Method Summary collapse

Instance Method Details

#unique_idObject

Get a unique ID that will always be the same for any Hash having the same content

Return
  • String: The unique ID



12
13
14
# File 'lib/MusicMaster/Hash.rb', line 12

def unique_id
  return Digest::MD5.hexdigest(self.to_a.sort.to_yaml)
end