Class: WinewooUser::Logs::CreateWinewooUserLog
- Inherits:
-
BaseUseCase
- Object
- BaseUseCase
- WinewooUser::Logs::CreateWinewooUserLog
- Defined in:
- lib/winewoo_core/use_cases/winewoo_user/logs/create_winewoo_user_log.rb
Instance Method Summary collapse
- #call(log_params) {|log.persisted? ? UseCaseResults.success(log) : UseCaseResults.failure(log.errors)| ... } ⇒ Object
-
#initialize(log_params = nil) ⇒ CreateWinewooUserLog
constructor
A new instance of CreateWinewooUserLog.
Constructor Details
#initialize(log_params = nil) ⇒ CreateWinewooUserLog
Returns a new instance of CreateWinewooUserLog.
4 5 6 |
# File 'lib/winewoo_core/use_cases/winewoo_user/logs/create_winewoo_user_log.rb', line 4 def initialize(log_params=nil) super(WinewooCore.winewoo_user_logs_repo.new, log_params) end |
Instance Method Details
#call(log_params) {|log.persisted? ? UseCaseResults.success(log) : UseCaseResults.failure(log.errors)| ... } ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/winewoo_core/use_cases/winewoo_user/logs/create_winewoo_user_log.rb', line 9 def call(log_params) log = self.repo.create(log_params) yield log.persisted? ? UseCaseResults.success(log) : UseCaseResults.failure(log.errors) end |