Class: Fzy::Match

Inherits:
Object
  • Object
show all
Defined in:
lib/fzy.rb

Instance Method Summary collapse

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

#positionsObject



17
18
19
# File 'lib/fzy.rb', line 17

def positions
  @positions ||= Fzy.positions(@needle, @haystack)
end

#scoreObject



13
14
15
# File 'lib/fzy.rb', line 13

def score
  @score ||= Fzy.score(@needle, @haystack)
end