Class: WinewooUser::Account::CreateWinewooUserForInterpro
- Inherits:
-
BaseUseCase
- Object
- BaseUseCase
- WinewooUser::Account::CreateWinewooUserForInterpro
- Defined in:
- lib/winewoo_core/use_cases/winewoo_user/account/create_winewoo_user_for_interpro.rb
Instance Method Summary collapse
- #call(current_interpro, winewoo_user_params) {|(wuser.valid? && device.valid? ) ? UseCaseResults.success(wuser) : UseCaseResults.failure(wuser.errors.to_a.concat(device.errors.to_a))| ... } ⇒ Object
-
#initialize(log_params = nil) ⇒ CreateWinewooUserForInterpro
constructor
A new instance of CreateWinewooUserForInterpro.
Constructor Details
#initialize(log_params = nil) ⇒ CreateWinewooUserForInterpro
Returns a new instance of CreateWinewooUserForInterpro.
4 5 6 |
# File 'lib/winewoo_core/use_cases/winewoo_user/account/create_winewoo_user_for_interpro.rb', line 4 def initialize(log_params=nil) super(WinewooCore::Repositories::Mongo::InterproWinewooUsersMongoRepo.new, log_params) end |
Instance Method Details
#call(current_interpro, winewoo_user_params) {|(wuser.valid? && device.valid? ) ? UseCaseResults.success(wuser) : UseCaseResults.failure(wuser.errors.to_a.concat(device.errors.to_a))| ... } ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/winewoo_core/use_cases/winewoo_user/account/create_winewoo_user_for_interpro.rb', line 9 def call(current_interpro, winewoo_user_params) wuser, device = self.repo.create(current_interpro, winewoo_user_params) yield (wuser.valid? && device.valid? ) ? UseCaseResults.success(wuser) : UseCaseResults.failure(wuser.errors.to_a.concat(device.errors.to_a)) end |