Class: Nuva::Queries::VaccineFuzzySearch
- Inherits:
-
Object
- Object
- Nuva::Queries::VaccineFuzzySearch
- Defined in:
- lib/nuva/queries.rb
Instance Method Summary collapse
- #call(pattern) ⇒ Object
-
#initialize(repositories) ⇒ VaccineFuzzySearch
constructor
A new instance of VaccineFuzzySearch.
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 |