Class: Ad::AgentArchitecture::Report::DslGenerator

Inherits:
Object
  • Object
show all
Includes:
KLog::Logging
Defined in:
lib/ad/agent_architecture/report/dsl_generator.rb

Overview

Generate DSL for an Agent Architecture workflow based on the workflow hash

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(workflow, display: true, clipboard: false) ⇒ DslGenerator

Returns a new instance of DslGenerator.



13
14
15
16
17
18
19
# File 'lib/ad/agent_architecture/report/dsl_generator.rb', line 13

def initialize(workflow, display: true, clipboard: false)
  @workflow_hash = workflow if workflow.is_a?(Hash)
  @workflow_hash = workflow.workflow if workflow.is_a?(Ad::AgentArchitecture::Dsl::WorkflowDsl)

  @display = display
  @clipboard = clipboard
end

Instance Attribute Details

#clipboardObject (readonly)

Returns the value of attribute clipboard.



11
12
13
# File 'lib/ad/agent_architecture/report/dsl_generator.rb', line 11

def clipboard
  @clipboard
end

#displayObject (readonly)

Returns the value of attribute display.



10
11
12
# File 'lib/ad/agent_architecture/report/dsl_generator.rb', line 10

def display
  @display
end

Instance Method Details

#dsl_for_attributesObject



27
28
29
30
31
# File 'lib/ad/agent_architecture/report/dsl_generator.rb', line 27

def dsl_for_attributes
  attributes_dsl = build_attributes_dsl
  render(attributes_dsl)
  attributes_dsl
end

#dsl_for_promptsObject



33
34
35
36
37
# File 'lib/ad/agent_architecture/report/dsl_generator.rb', line 33

def dsl_for_prompts
  prompts_dsl = build_prompts_dsl
  render(prompts_dsl)
  prompts_dsl
end

#dsl_for_sectionsObject



39
40
41
42
43
# File 'lib/ad/agent_architecture/report/dsl_generator.rb', line 39

def dsl_for_sections
  sections_dsl = build_sections_dsl
  render(sections_dsl)
  sections_dsl
end

#dsl_for_settingsObject



21
22
23
24
25
# File 'lib/ad/agent_architecture/report/dsl_generator.rb', line 21

def dsl_for_settings
  settings_dsl = build_settings_dsl
  render(settings_dsl)
  settings_dsl
end

#dsl_for_workflowObject



45
46
47
48
49
# File 'lib/ad/agent_architecture/report/dsl_generator.rb', line 45

def dsl_for_workflow
  workflow_dsl = build_workflow_dsl
  render(workflow_dsl)
  workflow_dsl
end