class RecordLinkage::ObjectComparer
Can be use to create an object with certian rules which can then be used to compare objects to each other
Public Class Methods
new() { |config| ... }
click to toggle source
# File lib/record_linkage/object_comparer.rb, line 96 def initialize yield config end
Public Instance Methods
classify_hash(object1, object2)
click to toggle source
# File lib/record_linkage/object_comparer.rb, line 104 def classify_hash(object1, object2) config.matchers.each_with_object({}) do |matcher, result| result[[matcher.property1, matcher.property2]] = matcher.score_objects(object1, object2, default_threshold, default_weight) end end
config()
click to toggle source
# File lib/record_linkage/object_comparer.rb, line 100 def config @config ||= Config.new end
default_threshold()
click to toggle source
# File lib/record_linkage/object_comparer.rb, line 114 def default_threshold config.default_threshold || 0.0 end
default_weight()
click to toggle source
# File lib/record_linkage/object_comparer.rb, line 118 def default_weight config.default_weight || 1.0 end