Class: Dscf::Banking::AccountCreationService
- Inherits:
-
Object
- Object
- Dscf::Banking::AccountCreationService
- Defined in:
- app/services/dscf/banking/account_creation_service.rb
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(application) ⇒ AccountCreationService
constructor
A new instance of AccountCreationService.
Constructor Details
#initialize(application) ⇒ AccountCreationService
Returns a new instance of AccountCreationService.
7 8 9 |
# File 'app/services/dscf/banking/account_creation_service.rb', line 7 def initialize(application) @application = application end |
Class Method Details
.call(application) ⇒ Object
3 4 5 |
# File 'app/services/dscf/banking/account_creation_service.rb', line 3 def self.call(application) new(application).call end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'app/services/dscf/banking/account_creation_service.rb', line 11 def call return nil unless @application.review_status == "approved" return nil if account_already_exists? create_account rescue => e Rails.logger.error "Account creation failed: #{e.}" if defined?(Rails) nil end |