Class: DevSuite::Workflow::Step::Loop

Inherits:
Base show all
Defined in:
lib/dev_suite/workflow/step/loop.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:, iterations:, &action) ⇒ Loop

Returns a new instance of Loop.



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

def initialize(name:, iterations:, &action)
  super(name: name, &action)
  @iterations = iterations
end

Instance Method Details

#run(context) ⇒ Object



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

def run(context)
  @iterations.times do |i|
    Utils::Logger.log("Step: #{@name} - Iteration: #{i + 1}", level: :info)
    super(context)
  end
end