Class: SearchCriterions::ListCriterions

Inherits:
BaseUseCase
  • Object
show all
Defined in:
lib/winewoo_core/use_cases/search_criterions/list_criterions.rb

Instance Method Summary collapse

Constructor Details

#initialize(log_params = nil) ⇒ ListCriterions

Returns a new instance of ListCriterions.



4
5
6
# File 'lib/winewoo_core/use_cases/search_criterions/list_criterions.rb', line 4

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

Instance Method Details

#call(filters) {|criterions ? UseCaseResults.found(criterions) : UseCaseResults.not_found| ... } ⇒ Object

Yields:



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

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

  yield criterions ?
    UseCaseResults.found(criterions) :
    UseCaseResults.not_found
end