Class: DumpCleaner::Cleanup::Workflow
- Inherits:
-
Object
- Object
- DumpCleaner::Cleanup::Workflow
- Defined in:
- lib/dump_cleaner/cleanup/workflow.rb
Instance Method Summary collapse
-
#initialize(phase:) ⇒ Workflow
constructor
A new instance of Workflow.
- #run(initial_step_context, step_configs:) ⇒ Object
Constructor Details
#initialize(phase:) ⇒ Workflow
Returns a new instance of Workflow.
6 7 8 9 |
# File 'lib/dump_cleaner/cleanup/workflow.rb', line 6 def initialize(phase:) @phase = phase @workflow_steps_cache = {} end |
Instance Method Details
#run(initial_step_context, step_configs:) ⇒ Object
11 12 13 14 15 |
# File 'lib/dump_cleaner/cleanup/workflow.rb', line 11 def run(initial_step_context, step_configs:) steps(type: initial_step_context.type, step_configs:).reduce(initial_step_context.dup) do |step_context, step| step.call(step_context) end end |