Sha256: 893503532a605b0c7d5453433ad8258765b06115d148b2adcde2d4fdf5162bb2

Contents?: true

Size: 467 Bytes

Versions: 4

Compression:

Stored size: 467 Bytes

Contents

# frozen_string_literal: true

module DevSuite
  module Workflow
    module Step
      class Loop < Base
        def initialize(name:, iterations:, &action)
          super(name: name, &action)
          @iterations = iterations
        end

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dev_suite-0.2.13 lib/dev_suite/workflow/step/loop.rb
dev_suite-0.2.12 lib/dev_suite/workflow/step/loop.rb
dev_suite-0.2.11 lib/dev_suite/workflow/step/loop.rb
dev_suite-0.2.10 lib/dev_suite/workflow/step/loop.rb