Class: MongoSearch::Matchers::ExactMatcher
- Inherits:
-
Object
- Object
- MongoSearch::Matchers::ExactMatcher
- Defined in:
- lib/mongo-search/matchers/exact_matcher.rb
Instance Method Summary collapse
- #call(params) ⇒ Object
-
#initialize(attr) ⇒ ExactMatcher
constructor
A new instance of ExactMatcher.
Constructor Details
#initialize(attr) ⇒ ExactMatcher
Returns a new instance of ExactMatcher.
4 5 6 |
# File 'lib/mongo-search/matchers/exact_matcher.rb', line 4 def initialize(attr) @attr = attr end |
Instance Method Details
#call(params) ⇒ Object
8 9 10 11 12 |
# File 'lib/mongo-search/matchers/exact_matcher.rb', line 8 def call(params) filters = {} filters[@attr] = params[@attr] if params[@attr] && !params[@attr].empty? filters end |