Sha256: 824e737509a24d8c9a032d82a91b77ca6670c2962c6f08109ccbe343f604cb4e

Contents?: true

Size: 866 Bytes

Versions: 1

Compression:

Stored size: 866 Bytes

Contents

# frozen_string_literal: true

module Ad
  module AgentArchitecture
    module Dsl
      # Helper methods for accessing data in the workflow DSL
      module DataAccessors
        def settings
          data[:settings]
        end

        def sections
          data[:sections]
        end

        def get_setting(name)
          settings[name.to_sym] || settings[name.to_s]
        end

        def attributes
          data[:attributes]
        end

        def get_attribute(name)
          attributes[name.to_sym] || attributes[name.to_s]
        end

        def prompts
          data[:prompts]
        end

        def get_prompt(name)
          prompts[name.to_sym] || prompts[name.to_s]
        end

        def get_prompt_content(name)
          lookup = get_prompt(name)
          lookup ? lookup[:content] : nil
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ad-agent_architecture-0.0.22 lib/ad/agent_architecture/dsl/data_accessors.rb