Class: YAMLFileTemplate

Inherits:
Object
  • Object
show all
Defined in:
lib/yaml_file_template.rb

Class Method Summary collapse

Class Method Details

.load_from_yaml(yaml) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/yaml_file_template.rb', line 6

def self.load_from_yaml(yaml)
  parsed_options = YAML.load(yaml)
  file_template = FileTemplate.new({
    :identifier => parsed_options["identifier"],
    :project_root => parsed_options["project_root"]
  })
  parsed_options["included_dirs"].each do |dir|
    file_template.include_dir(dir)
  end
  return file_template
end