Class: Decouplio::Steps::ServicePass

Inherits:
BaseStep
  • Object
show all
Defined in:
lib/decouplio/steps/service_pass.rb

Instance Attribute Summary

Attributes inherited from BaseStep

#name

Instance Method Summary collapse

Constructor Details

#initialize(name:, service:, args:, on_success_type:, on_failure_type:) ⇒ ServicePass

Returns a new instance of ServicePass.



8
9
10
11
12
13
14
15
# File 'lib/decouplio/steps/service_pass.rb', line 8

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



17
18
19
20
21
22
23
24
25
26
# File 'lib/decouplio/steps/service_pass.rb', line 17

def process(instance:)
  instance.append_railway_flow(@name)
  @service.call(
    ctx: instance.ctx,
    ms: instance.meta_store,
    **@args
  )

  resolve(instance: instance)
end