Class: IdentityParade::Match
- Inherits:
-
Object
- Object
- IdentityParade::Match
- Defined in:
- lib/identity_parade/match.rb
Overview
The initial starting point for a matching.
Instance Method Summary collapse
-
#initialize(left, right) ⇒ Match
constructor
A new instance of Match.
-
#matcher ⇒ Class
The matcher class.
-
#matcher_class_name ⇒ String
The matcher class name.
-
#score ⇒ Float
The matching score.
Constructor Details
#initialize(left, right) ⇒ Match
Returns a new instance of Match.
6 7 8 9 |
# File 'lib/identity_parade/match.rb', line 6 def initialize(left, right) @left = left @right = right end |
Instance Method Details
#matcher ⇒ Class
Returns The matcher class.
19 20 21 |
# File 'lib/identity_parade/match.rb', line 19 def matcher matcher_class_name.constantize end |
#matcher_class_name ⇒ String
Returns the matcher class name.
24 25 26 |
# File 'lib/identity_parade/match.rb', line 24 def matcher_class_name "identity_parade/matchers/#{@left.class.name.underscore}_matcher".classify end |
#score ⇒ Float
Returns the matching score.
12 13 14 15 16 |
# File 'lib/identity_parade/match.rb', line 12 def score return unless Kernel.const_defined?(matcher_class_name) matcher.new(@left, @right).score end |