Class: Chemtrail::Template

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(description) ⇒ Template

Returns a new instance of Template.



6
7
8
# File 'lib/chemtrail/template.rb', line 6

def initialize(description)
  @description = description
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



4
5
6
# File 'lib/chemtrail/template.rb', line 4

def description
  @description
end

Instance Method Details

#mappingsObject



14
15
16
# File 'lib/chemtrail/template.rb', line 14

def mappings
  @mappings ||= Chemtrail::Section.new
end

#outputsObject



22
23
24
# File 'lib/chemtrail/template.rb', line 22

def outputs
  @outputs ||= Chemtrail::Section.new
end

#parametersObject



10
11
12
# File 'lib/chemtrail/template.rb', line 10

def parameters
  @parameters ||= Chemtrail::Section.new
end

#resourcesObject



18
19
20
# File 'lib/chemtrail/template.rb', line 18

def resources
  @resources ||= Chemtrail::Section.new
end

#to_hashObject



26
27
28
29
30
31
32
33
34
35
# File 'lib/chemtrail/template.rb', line 26

def to_hash
  {
    "AWSTemplateFormatVersion" => "2010-09-09",
    "Description" => description,
    "Parameters" => parameters.to_hash,
    "Mappings" => mappings.to_hash,
    "Resources" => resources.to_hash,
    "Outputs" => outputs.to_hash
  }
end