Class: Phash::HashData

Inherits:
Data
  • Object
show all
Defined in:
lib/phash.rb

Direct Known Subclasses

AudioHash, ImageHash, TextHash, VideoHash

Instance Attribute Summary

Attributes inherited from Data

#data, #length

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Data

#initialize

Constructor Details

This class inherits a constructor from Phash::Data

Class Method Details

.hash_typeObject



17
18
19
# File 'lib/phash.rb', line 17

def self.hash_type
  @hash_type ||= self.name.split('::').last.sub(/Hash$/, '').downcase
end

Instance Method Details

#similarity(other, *args) ⇒ Object



13
14
15
# File 'lib/phash.rb', line 13

def similarity(other, *args)
  Phash.send("#{self.class.hash_type}_similarity", self, other, *args)
end