class IdentityParade::Match

The initial starting point for a matching.

Public Class Methods

new(left, right) click to toggle source
# File lib/identity_parade/match.rb, line 6
def initialize(left, right)
  @left = left
  @right = right
end

Public Instance Methods

matcher() click to toggle source

@return [Class] The matcher class

# File lib/identity_parade/match.rb, line 19
def matcher
  matcher_class_name.constantize
end
matcher_class_name() click to toggle source

@return [String] the matcher class name

# File lib/identity_parade/match.rb, line 24
def matcher_class_name
  "identity_parade/matchers/#{@left.class.name.underscore}_matcher".classify
end
score() click to toggle source

@return [Float] the matching score

# File lib/identity_parade/match.rb, line 12
def score
  return unless Kernel.const_defined?(matcher_class_name)

  matcher.new(@left, @right).score
end