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
- #attributes ⇒ Object
- #get_attribute(name) ⇒ Object
- #get_prompt(name) ⇒ Object
- #get_setting(name) ⇒ Object
- #prompt_content(name, default: nil) ⇒ Object
- #prompts ⇒ Object
- #sections ⇒ Object
- #setting_value(name, default: nil) ⇒ Object
- #settings ⇒ Object
Instance Method Details
#attributes ⇒ Object
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 |
#prompts ⇒ Object
33 34 35 |
# File 'lib/ad/agent_architecture/dsl/data_accessors.rb', line 33 def prompts data[:prompts] end |
#sections ⇒ Object
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 |
#settings ⇒ Object
8 9 10 |
# File 'lib/ad/agent_architecture/dsl/data_accessors.rb', line 8 def settings data[:settings] end |