Class: WinewooCore::Services::Finders::Producers::ProducersFinderBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/winewoo_core/services/finders/producers/producers_finder_builder.rb

Class Method Summary collapse

Class Method Details

.build(filters) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/winewoo_core/services/finders/producers/producers_finder_builder.rb', line 4

def self.build(filters)
  query = filters.query
  case query
  when nil
    AllProducersFinder.new(filters)
  else
    query.is_a?(String) ?
      KeywordsProducersFinder.new(filters) :
      FiltersProducersFinder.new(filters)
  end
end