Method: Stackup::YAML.load

Defined in:
lib/stackup/yaml.rb

.load(yaml, filename = nil) ⇒ Object

Load YAML stream/string into a Ruby data structure.

Supports CloudFormation extensions:

`!Ref blah` as a shortcut for `{ "Ref" => blah }`
`!Foo blah` as a shortcut for `{ "Fn::Foo" => blah }`


24
25
26
27
28
29
# File 'lib/stackup/yaml.rb', line 24

def load(yaml, filename = nil)
  tree = ::YAML.parse(yaml, filename)
  return tree unless tree

  CloudFormationToRuby.create.accept(tree)
end