Class: Cfnlego::CloudFormation
- Inherits:
-
Object
- Object
- Cfnlego::CloudFormation
- Defined in:
- lib/cfndsl/cfnlego/cloudformation.rb
Overview
CloudFormation
Constant Summary collapse
- TEMPLATE =
"#{File.dirname(__FILE__)}/cloudformation.erb"
Instance Attribute Summary collapse
-
#resources ⇒ Object
readonly
Returns the value of attribute resources.
Instance Method Summary collapse
-
#initialize(resources) ⇒ CloudFormation
constructor
A new instance of CloudFormation.
- #render ⇒ Object
Constructor Details
#initialize(resources) ⇒ CloudFormation
Returns a new instance of CloudFormation.
11 12 13 14 |
# File 'lib/cfndsl/cfnlego/cloudformation.rb', line 11 def initialize(resources) @description = 'auto generated cloudformation cfndsl template' @resources = resources end |
Instance Attribute Details
#resources ⇒ Object (readonly)
Returns the value of attribute resources.
9 10 11 |
# File 'lib/cfndsl/cfnlego/cloudformation.rb', line 9 def resources @resources end |
Instance Method Details
#render ⇒ Object
16 17 18 19 |
# File 'lib/cfndsl/cfnlego/cloudformation.rb', line 16 def render erb = ERB.new(File.read(TEMPLATE), trim_mode: '-') erb.result(binding) end |