Class: Producers::ShowProducer
- Inherits:
-
BaseUseCase
- Object
- BaseUseCase
- Producers::ShowProducer
- Defined in:
- lib/winewoo_core/use_cases/producers/show_producer.rb
Instance Method Summary collapse
- #call(producer_id) {|producer ? UseCaseResults.found(producer) : UseCaseResults.not_found| ... } ⇒ Object
-
#initialize(log_params = nil) ⇒ ShowProducer
constructor
A new instance of ShowProducer.
Constructor Details
#initialize(log_params = nil) ⇒ ShowProducer
Returns a new instance of ShowProducer.
4 5 6 |
# File 'lib/winewoo_core/use_cases/producers/show_producer.rb', line 4 def initialize(log_params=nil) super(WinewooCore.producers_repo.new, log_params) end |
Instance Method Details
#call(producer_id) {|producer ? UseCaseResults.found(producer) : UseCaseResults.not_found| ... } ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/winewoo_core/use_cases/producers/show_producer.rb', line 9 def call(producer_id) producer = self.repo.get(producer_id) yield producer ? UseCaseResults.found(producer) : UseCaseResults.not_found end |