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