Class: Nuva::Queries::VaccineFuzzySearch

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

Instance Method Summary collapse

Constructor Details

#initialize(repositories) ⇒ VaccineFuzzySearch

Returns a new instance of VaccineFuzzySearch.



108
109
110
111
112
# File 'lib/nuva/queries.rb', line 108

def initialize(repositories)
  @engine = FuzzyMatch.new(repositories.vaccines.all, read: ->(v) {
    v.name
  })
end

Instance Method Details

#call(pattern) ⇒ Object



114
115
116
# File 'lib/nuva/queries.rb', line 114

def call(pattern)
  @engine.find_all(pattern)
end