Class: Moonshot::StackTemplate
- Inherits:
-
Object
- Object
- Moonshot::StackTemplate
show all
- Defined in:
- lib/moonshot/stack_template.rb
Overview
A StackTemplate loads the template from disk and stores information about it.
Instance Method Summary
collapse
Constructor Details
Returns a new instance of StackTemplate.
7
8
9
|
# File 'lib/moonshot/stack_template.rb', line 7
def initialize(filename)
@filename = filename
end
|
Instance Method Details
#exist? ⇒ Boolean
23
24
25
|
# File 'lib/moonshot/stack_template.rb', line 23
def exist?
File.exist?(@filename)
end
|
#parameters ⇒ Object
11
12
13
14
15
16
17
|
# File 'lib/moonshot/stack_template.rb', line 11
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
19
20
21
|
# File 'lib/moonshot/stack_template.rb', line 19
def resource_names
template_body.fetch('Resources', {}).keys
end
|