Class: Services::CreateConfiguredAccountContext
- Inherits:
-
Object
- Object
- Services::CreateConfiguredAccountContext
- Defined in:
- app/contexts/services/create_configured_account_context.rb
Instance Attribute Summary collapse
-
#ca_params ⇒ Object
Returns the value of attribute ca_params.
-
#cred_params ⇒ Object
Returns the value of attribute cred_params.
-
#service_definition ⇒ Object
Returns the value of attribute service_definition.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(service_definition, ca_params, cred_params) ⇒ CreateConfiguredAccountContext
constructor
A new instance of CreateConfiguredAccountContext.
Constructor Details
#initialize(service_definition, ca_params, cred_params) ⇒ CreateConfiguredAccountContext
Returns a new instance of CreateConfiguredAccountContext.
11 12 13 14 15 16 |
# File 'app/contexts/services/create_configured_account_context.rb', line 11 def initialize(service_definition, ca_params, cred_params) @service_definition = service_definition @ca_params = ca_params @cred_params = cred_params @service_definition.extend Services::ConfiguredAccountCreator end |
Instance Attribute Details
#ca_params ⇒ Object
Returns the value of attribute ca_params.
5 6 7 |
# File 'app/contexts/services/create_configured_account_context.rb', line 5 def ca_params @ca_params end |
#cred_params ⇒ Object
Returns the value of attribute cred_params.
5 6 7 |
# File 'app/contexts/services/create_configured_account_context.rb', line 5 def cred_params @cred_params end |
#service_definition ⇒ Object
Returns the value of attribute service_definition.
5 6 7 |
# File 'app/contexts/services/create_configured_account_context.rb', line 5 def service_definition @service_definition end |
Class Method Details
.call(service_definition, ca_params, cred_params) ⇒ Object
7 8 9 |
# File 'app/contexts/services/create_configured_account_context.rb', line 7 def self.call(service_definition, ca_params, cred_params) CreateConfiguredAccountContext.new(service_definition, ca_params, cred_params).call end |
Instance Method Details
#call ⇒ Object
18 19 20 21 22 |
# File 'app/contexts/services/create_configured_account_context.rb', line 18 def call service_definition.create(ca_params).tap do | configured_account | CreateCredentialContext.call(configured_account, cred_params) if cred_params.present? end end |