Class: DevSuite::Workflow::Step::Composite
- Inherits:
-
Base
- Object
- Utils::Construct::Component::Base
- Base
- DevSuite::Workflow::Step::Composite
- Defined in:
- lib/dev_suite/workflow/step/composite.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(name:) ⇒ Composite
constructor
A new instance of Composite.
-
#run(context) ⇒ Object
Override execute to run all steps in sequence.
-
#step(step) ⇒ Object
Add steps to the composite.
Methods inherited from Base
Methods inherited from Utils::Construct::Component::Base
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 |