Class: Ad::AgentArchitecture::Dsl::Actions::SaveYaml

Inherits:
Object
  • Object
show all
Defined in:
lib/ad/agent_architecture/dsl/actions/save_yaml.rb

Overview

Save workflow graph to YAML file

Instance Method Summary collapse

Constructor Details

#initialize(workflow_hash) ⇒ SaveYaml

Returns a new instance of SaveYaml.



11
12
13
# File 'lib/ad/agent_architecture/dsl/actions/save_yaml.rb', line 11

def initialize(workflow_hash)
  @workflow_hash = workflow_hash
end

Instance Method Details

#save(file_name) ⇒ Object



15
16
17
# File 'lib/ad/agent_architecture/dsl/actions/save_yaml.rb', line 15

def save(file_name)
  File.write(file_name, @workflow_hash.to_yaml)
end