Class: Moonshot::StackTemplate
- Inherits:
-
Object
- Object
- Moonshot::StackTemplate
- Defined in:
- lib/moonshot/stack_template.rb
Overview
A StackTemplate loads the template from disk and stores information about it.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
Instance Method Summary collapse
- #exist? ⇒ Boolean
-
#initialize(filename) ⇒ StackTemplate
constructor
A new instance of StackTemplate.
- #parameters ⇒ Object
- #resource_names ⇒ Object
Constructor Details
#initialize(filename) ⇒ StackTemplate
Returns a new instance of StackTemplate.
9 10 11 |
# File 'lib/moonshot/stack_template.rb', line 9 def initialize(filename) @filename = filename end |
Instance Attribute Details
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
7 8 9 |
# File 'lib/moonshot/stack_template.rb', line 7 def filename @filename end |
Instance Method Details
#exist? ⇒ Boolean
25 26 27 |
# File 'lib/moonshot/stack_template.rb', line 25 def exist? File.exist?(@filename) end |
#parameters ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/moonshot/stack_template.rb', line 13 def parameters template_body.fetch('Parameters', {}).map do |k, v| StackParameter.new(k, default: v['Default'], description: v.fetch('Description', '')) end end |
#resource_names ⇒ Object
21 22 23 |
# File 'lib/moonshot/stack_template.rb', line 21 def resource_names template_body.fetch('Resources', {}).keys end |