Class: Fzy::Match
- Inherits:
-
Object
- Object
- Fzy::Match
- Defined in:
- lib/fzy.rb
Instance Method Summary collapse
-
#initialize(needle, haystack) ⇒ Match
constructor
A new instance of Match.
- #positions ⇒ Object
- #score ⇒ Object
Constructor Details
#initialize(needle, haystack) ⇒ Match
Returns a new instance of Match.
8 9 10 11 |
# File 'lib/fzy.rb', line 8 def initialize(needle, haystack) @needle = needle @haystack = haystack end |
Instance Method Details
#positions ⇒ Object
17 18 19 |
# File 'lib/fzy.rb', line 17 def positions @positions ||= Fzy.positions(@needle, @haystack) end |
#score ⇒ Object
13 14 15 |
# File 'lib/fzy.rb', line 13 def score @score ||= Fzy.score(@needle, @haystack) end |