Class: Producers::ListProducers

Inherits:
BaseUseCase
  • Object
show all
Defined in:
lib/winewoo_core/use_cases/producers/list_producers.rb

Instance Method Summary collapse

Constructor Details

#initialize(log_params = nil) ⇒ ListProducers

Returns a new instance of ListProducers.



4
5
6
# File 'lib/winewoo_core/use_cases/producers/list_producers.rb', line 4

def initialize(log_params=nil)
  super(WinewooCore.producers_repo.new, log_params)
end

Instance Method Details

#call(filters) {|producers ? UseCaseResults.found(producers) : UseCaseResults.failure| ... } ⇒ Object

Yields:



9
10
11
12
13
14
15
# File 'lib/winewoo_core/use_cases/producers/list_producers.rb', line 9

def call(filters)
  producers = self.repo.find(filters)

  yield producers ?
    UseCaseResults.found(producers) :
    UseCaseResults.failure
end