Class: TerraformDSL::Outputs
- Inherits:
-
Object
- Object
- TerraformDSL::Outputs
- Defined in:
- lib/terraformdsl/common.rb
Instance Method Summary collapse
- #define(key, val) ⇒ Object (also: #[]=)
- #generate_tf ⇒ Object
-
#initialize ⇒ Outputs
constructor
A new instance of Outputs.
Constructor Details
#initialize ⇒ Outputs
Returns a new instance of Outputs.
88 89 90 |
# File 'lib/terraformdsl/common.rb', line 88 def initialize @dict = {} end |
Instance Method Details
#define(key, val) ⇒ Object Also known as: []=
92 93 94 |
# File 'lib/terraformdsl/common.rb', line 92 def define(key, val) @dict[key] = val end |
#generate_tf ⇒ Object
98 99 100 101 102 103 104 105 106 107 |
# File 'lib/terraformdsl/common.rb', line 98 def generate_tf tf = "" @dict.each do |k, v| tf << "output \"#{k}\" {\n" tf << " value = \"#{v}\"\n" tf << "}\n" tf << "\n" end return tf end |