Class: Decouplio::Steps::ServiceStep
- Defined in:
- lib/decouplio/steps/service_step.rb
Instance Attribute Summary
Attributes inherited from BaseStep
Instance Method Summary collapse
-
#initialize(name:, service:, args:, on_success_type:, on_failure_type:) ⇒ ServiceStep
constructor
A new instance of ServiceStep.
- #process(instance:) ⇒ Object
Constructor Details
#initialize(name:, service:, args:, on_success_type:, on_failure_type:) ⇒ ServiceStep
Returns a new instance of ServiceStep.
9 10 11 12 13 14 15 16 |
# File 'lib/decouplio/steps/service_step.rb', line 9 def initialize(name:, service:, args:, on_success_type:, on_failure_type:) super() @name = name @service = service @args = args @on_success_type = on_success_type @on_failure_type = on_failure_type end |
Instance Method Details
#process(instance:) ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/decouplio/steps/service_step.rb', line 18 def process(instance:) instance.append_railway_flow(@name) result = @service.call( ctx: instance.ctx, ms: instance., **@args ) resolve(result: result, instance: instance) end |