Class: WinewooUser::Account::UpdateWinewooUser
- Inherits:
-
BaseUseCase
- Object
- BaseUseCase
- WinewooUser::Account::UpdateWinewooUser
- Defined in:
- lib/winewoo_core/use_cases/winewoo_user/account/update_winewoo_user.rb
Instance Method Summary collapse
- #call(winewoo_user_id, winewoo_user_params) {|winewoo_user ? (winewoo_user.errors.blank? ? UseCaseResults.success(winewoo_user) : UseCaseResults.failure(winewoo_user.errors)) : UseCaseResults.not_found| ... } ⇒ Object
-
#initialize(log_params = nil) ⇒ UpdateWinewooUser
constructor
A new instance of UpdateWinewooUser.
Constructor Details
#initialize(log_params = nil) ⇒ UpdateWinewooUser
Returns a new instance of UpdateWinewooUser.
4 5 6 |
# File 'lib/winewoo_core/use_cases/winewoo_user/account/update_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_params) {|winewoo_user ? (winewoo_user.errors.blank? ? UseCaseResults.success(winewoo_user) : UseCaseResults.failure(winewoo_user.errors)) : UseCaseResults.not_found| ... } ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/winewoo_core/use_cases/winewoo_user/account/update_winewoo_user.rb', line 9 def call(winewoo_user_id, winewoo_user_params) winewoo_user = self.repo.update(winewoo_user_id, winewoo_user_params) yield winewoo_user ? (winewoo_user.errors.blank? ? UseCaseResults.success(winewoo_user) : UseCaseResults.failure(winewoo_user.errors)) : UseCaseResults.not_found end |