Class: FzyScore::Match
- Inherits:
-
Struct
- Object
- Struct
- FzyScore::Match
- Defined in:
- lib/fzy_score/match.rb
Overview
Result of a scored fuzzy match.
score Float relevance score. Higher is better. SCORE_MAX for an
exact (case-insensitive) match, {SCORE_MIN} for no match / empty
needle / oversized candidate.
positions Array<Integer> of the indices in haystack that the needle
matched, suitable for highlighting. +nil+ unless positions were
requested.
Instance Attribute Summary collapse
-
#positions ⇒ Object
Returns the value of attribute positions.
-
#score ⇒ Object
Returns the value of attribute score.
Instance Method Summary collapse
-
#matched? ⇒ Boolean
True when the candidate actually matched.
Instance Attribute Details
#positions ⇒ Object
Returns the value of attribute positions
12 13 14 |
# File 'lib/fzy_score/match.rb', line 12 def positions @positions end |
#score ⇒ Object
Returns the value of attribute score
12 13 14 |
# File 'lib/fzy_score/match.rb', line 12 def score @score end |
Instance Method Details
#matched? ⇒ Boolean
Returns true when the candidate actually matched.
14 15 16 |
# File 'lib/fzy_score/match.rb', line 14 def matched? score > SCORE_MIN end |