Sha256: 2c529921fedf847d17e69d80edd9c48b5194a9a954fe4c0c3b9e958ef6c6a77a

Contents?: true

Size: 704 Bytes

Versions: 2

Compression:

Stored size: 704 Bytes

Contents

# frozen_string_literal: true

module Ad
  module AgentArchitecture
    module Dsl
      # This class is responsible for defining the steps of a section
      class StepDsl
        def initialize(name, order, steps)
          @step = { name: name, order: order, input_attributes: [], output_attributes: [], prompt: '' }
          @steps = steps
          @steps << @step
        end

        def input(attr_name, **_opts)
          @step[:input_attributes] << attr_name
        end

        def output(attr_name, **_opts)
          @step[:output_attributes] << attr_name
        end

        def prompt(prompt_text, **_opts)
          @step[:prompt] = prompt_text
        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/step_dsl.rb
ad-agent_architecture-0.0.10 lib/ad/agent_architecture/dsl/step_dsl.rb