Module: Ad::AgentArchitecture::Dsl::DataAccessors

Included in:
ChildDsl, WorkflowDsl
Defined in:
lib/ad/agent_architecture/dsl/data_accessors.rb

Overview

Helper methods for accessing data in the workflow DSL

Instance Method Summary collapse

Instance Method Details

#attributesObject



25
26
27
# File 'lib/ad/agent_architecture/dsl/data_accessors.rb', line 25

def attributes
  data[:attributes]
end

#get_attribute(name) ⇒ Object



29
30
31
# File 'lib/ad/agent_architecture/dsl/data_accessors.rb', line 29

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

#get_prompt(name) ⇒ Object



37
38
39
# File 'lib/ad/agent_architecture/dsl/data_accessors.rb', line 37

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

#get_setting(name) ⇒ Object



16
17
18
# File 'lib/ad/agent_architecture/dsl/data_accessors.rb', line 16

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

#prompt_content(name, default: nil) ⇒ Object



41
42
43
44
# File 'lib/ad/agent_architecture/dsl/data_accessors.rb', line 41

def prompt_content(name, default: nil)
  lookup = get_prompt(name)
  lookup ? lookup[:content] : default
end

#promptsObject



33
34
35
# File 'lib/ad/agent_architecture/dsl/data_accessors.rb', line 33

def prompts
  data[:prompts]
end

#sectionsObject



12
13
14
# File 'lib/ad/agent_architecture/dsl/data_accessors.rb', line 12

def sections
  data[:sections]
end

#setting_value(name, default: nil) ⇒ Object



20
21
22
23
# File 'lib/ad/agent_architecture/dsl/data_accessors.rb', line 20

def setting_value(name, default: nil)
  lookup = get_setting(name)
  lookup ? lookup[:value] : default
end

#settingsObject



8
9
10
# File 'lib/ad/agent_architecture/dsl/data_accessors.rb', line 8

def settings
  data[:settings]
end