Class: DevSuite::Workflow::Step::Composite

Inherits:
Base show all
Defined in:
lib/dev_suite/workflow/step/composite.rb

Instance Attribute Summary

Attributes inherited from Base

#name, #next_step

Instance Method Summary collapse

Methods inherited from Base

#next

Methods inherited from Utils::Construct::Component::Base

component_key

Constructor Details

#initialize(name:) ⇒ Composite

Returns a new instance of Composite.



7
8
9
10
# File 'lib/dev_suite/workflow/step/composite.rb', line 7

def initialize(name:)
  super
  @steps = []
end

Instance Method Details

#run(context) ⇒ Object

Override execute to run all steps in sequence



19
20
21
22
23
# File 'lib/dev_suite/workflow/step/composite.rb', line 19

def run(context)
  @steps.each do |step|
    step.run(context)
  end
end

#step(step) ⇒ Object

Add steps to the composite



13
14
15
16
# File 'lib/dev_suite/workflow/step/composite.rb', line 13

def step(step)
  @steps << step
  self
end