Class: Doodle::Keyword::FinderService
- Inherits:
-
Object
- Object
- Doodle::Keyword::FinderService
show all
- Defined in:
- app/services/doodle/keyword/finder_service.rb
Instance Method Summary
collapse
Constructor Details
Returns a new instance of FinderService.
3
4
5
|
# File 'app/services/doodle/keyword/finder_service.rb', line 3
def initialize(params)
@params = params
end
|
Instance Method Details
#call ⇒ Object
7
8
9
10
11
12
13
|
# File 'app/services/doodle/keyword/finder_service.rb', line 7
def call
scope = nil
@params.each do |k, v|
scope = klass.where(k.to_s => v)
end
scope.all
end
|
#klass ⇒ Object
15
16
17
|
# File 'app/services/doodle/keyword/finder_service.rb', line 15
def klass
Doodle::Keyword
end
|