Class: ObjectSimilarity::ExactFieldScorer

Inherits:
FieldScorer
  • Object
show all
Defined in:
lib/object_similarity.rb

Instance Attribute Summary

Attributes inherited from FieldScorer

#field, #weight

Instance Method Summary collapse

Methods inherited from FieldScorer

#get_value, #initialize, #skip_value?, #value, #weighted_distance

Constructor Details

This class inherits a constructor from ObjectSimilarity::FieldScorer

Instance Method Details

#distance(other_object) ⇒ Object



40
41
42
# File 'lib/object_similarity.rb', line 40

def distance(other_object)
  (value == get_value(other_object)) ? 0 : 1
end