Class: Producers::ListProducers
- Inherits:
-
BaseUseCase
- Object
- BaseUseCase
- Producers::ListProducers
- Defined in:
- lib/winewoo_core/use_cases/producers/list_producers.rb
Instance Method Summary collapse
- #call(filters) {|producers ? UseCaseResults.found(producers) : UseCaseResults.failure| ... } ⇒ Object
-
#initialize(log_params = nil) ⇒ ListProducers
constructor
A new instance of ListProducers.
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
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 |