Class: Simhilarity::Candidate
- Inherits:
-
Object
- Object
- Simhilarity::Candidate
- Defined in:
- lib/simhilarity/candidate.rb
Overview
A potential match between two Elements
. It can calculate it’s own score.
Instance Attribute Summary collapse
-
#a ⇒ Object
readonly
first half of the candidate pair - the needle.
-
#b ⇒ Object
readonly
first half of the candidate pair - the haystack.
-
#score ⇒ Object
the score between these two candidates.
Instance Method Summary collapse
-
#initialize(a, b) ⇒ Candidate
constructor
:nodoc:.
-
#to_s ⇒ Object
:nodoc:.
Constructor Details
#initialize(a, b) ⇒ Candidate
:nodoc:
13 14 15 16 |
# File 'lib/simhilarity/candidate.rb', line 13 def initialize(a, b) #:nodoc: @a = a @b = b end |
Instance Attribute Details
#a ⇒ Object (readonly)
first half of the candidate pair - the needle.
5 6 7 |
# File 'lib/simhilarity/candidate.rb', line 5 def a @a end |
#b ⇒ Object (readonly)
first half of the candidate pair - the haystack.
8 9 10 |
# File 'lib/simhilarity/candidate.rb', line 8 def b @b end |
#score ⇒ Object
the score between these two candidates
11 12 13 |
# File 'lib/simhilarity/candidate.rb', line 11 def score @score end |
Instance Method Details
#to_s ⇒ Object
:nodoc:
18 19 20 |
# File 'lib/simhilarity/candidate.rb', line 18 def to_s #:nodoc: "Candidate #{score}: #{a.inspect}..#{b.inspect}" end |