Class: WinewooUser::Cellar::GetCellar

Inherits:
BaseUseCase
  • Object
show all
Defined in:
lib/winewoo_core/use_cases/winewoo_user/cellar/get_cellar.rb

Instance Method Summary collapse

Constructor Details

#initialize(log_params = nil) ⇒ GetCellar

Returns a new instance of GetCellar.



4
5
6
# File 'lib/winewoo_core/use_cases/winewoo_user/cellar/get_cellar.rb', line 4

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

Instance Method Details

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

Yields:



9
10
11
12
13
14
15
# File 'lib/winewoo_core/use_cases/winewoo_user/cellar/get_cellar.rb', line 9

def call(winewoo_user, filters)
  cellar_entries = self.repo.find(winewoo_user, filters)

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