Sha256: b8e92a5f12c7a38c1f59a68b912263c3c3c6fd3a3c07408c6f405e6d4da38548

Contents?: true

Size: 592 Bytes

Versions: 2

Compression:

Stored size: 592 Bytes

Contents

# frozen_string_literal: true

module Ad
  module AgentArchitecture
    module Dsl
      # This class is responsible for creating a section in the workflow
      class SectionDsl
        def initialize(name, order, sections)
          @section = { name: name, order: order, steps: [] }
          @sections = sections
          @current_step_order = 1
          @sections << @section
        end

        def step(name:, &block)
          StepDsl.new(name, @current_step_order, @section[:steps]).instance_eval(&block)
          @current_step_order += 1
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ad-agent_architecture-0.0.11 lib/ad/agent_architecture/dsl/section_dsl.rb
ad-agent_architecture-0.0.10 lib/ad/agent_architecture/dsl/section_dsl.rb