Class: WinewooUser::Account::ShowWinewooUser

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

Instance Method Summary collapse

Constructor Details

#initialize(log_params = nil) ⇒ ShowWinewooUser

Returns a new instance of ShowWinewooUser.



4
5
6
# File 'lib/winewoo_core/use_cases/winewoo_user/account/show_winewoo_user.rb', line 4

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

Instance Method Details

#call(winewoo_user_id) {|winewoo_user ? UseCaseResults.found(winewoo_user) : UseCaseResults.not_found| ... } ⇒ Object

Yields:



9
10
11
12
13
14
# File 'lib/winewoo_core/use_cases/winewoo_user/account/show_winewoo_user.rb', line 9

def call(winewoo_user_id)
  winewoo_user = self.repo.get(winewoo_user_id)
  yield winewoo_user ?
    UseCaseResults.found(winewoo_user) :
    UseCaseResults.not_found
end