Class AutomateIt::FieldManager::YAML
In: lib/automateit/field_manager.rb
Parent: AutomateIt::FieldManager::Struct

FieldManager::YAML

A FieldManager driver that reads its data structure from a file.

Methods

setup  

Public Instance methods

Options:

  • :file — Filename to read data structure from. Contents will be parsed with ERB and then handed to YAML.

[Source]

# File lib/automateit/field_manager.rb, line 88
  def setup(opts={})
    if filename = opts.delete(:file)
      contents = _read(filename)
      binder = interpreter.send(:binding)
      output = HelpfulERB.new(contents, filename).result(binder)

      opts[:struct] = ::YAML::load(output)
    end
    super(opts)
  end

[Validate]