Class: Stackup::YAML::CloudFormationToRuby

Inherits:
Psych::Visitors::ToRuby
  • Object
show all
Defined in:
lib/stackup/yaml.rb

Overview

Custom Psych node visitor, with CloudFormation extensions.

Instance Method Summary collapse

Instance Method Details

#accept(target) ⇒ Object



46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/stackup/yaml.rb', line 46

def accept(target)
  case target.tag
  when "!Ref"
    { "Ref" => super }
  when "!GetAtt"
    { "Fn::GetAtt" => super.split(".") }
  when "!GetAZs"
    { "Fn::GetAZs" => (super || "") }
  when /^!(\w+)$/
    { "Fn::#{$1}" => super }
  else
    super
  end
end