Class: WinewooUser::History::GetHistory

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

Instance Method Summary collapse

Constructor Details

#initialize(log_params = nil) ⇒ GetHistory

Returns a new instance of GetHistory.



4
5
6
# File 'lib/winewoo_core/use_cases/winewoo_user/history/get_history.rb', line 4

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

Instance Method Details

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

Yields:



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

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

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