Class: Chemtrail::Template

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(description = nil) ⇒ Template

Returns a new instance of Template.



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

def initialize(description = nil)
  @description = description
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



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

def description
  @description
end

Class Method Details

.inherited(subclass) ⇒ Object



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

def inherited(subclass)
  subclass_map[Chemtrail::ClassNameInflector.new(subclass).underscore] = subclass
end

.subclass_mapObject



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

def subclass_map
  @subclass_map ||= {}
end

Instance Method Details

#mappingsObject



25
26
27
# File 'lib/chemtrail/template.rb', line 25

def mappings
  []
end

#outputsObject



33
34
35
# File 'lib/chemtrail/template.rb', line 33

def outputs
  []
end

#parametersObject



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

def parameters
  []
end

#resourcesObject



29
30
31
# File 'lib/chemtrail/template.rb', line 29

def resources
  []
end

#to_hashObject



37
38
39
40
41
42
43
44
# File 'lib/chemtrail/template.rb', line 37

def to_hash
  version_hash = {"AWSTemplateFormatVersion" => "2010-09-09"}
  version_hash.merge(description_hash)
              .merge(parameters_hash)
              .merge(mappings_hash)
              .merge(resources_hash)
              .merge(outputs_hash)
end