Class: GeoEngineer::Output
- Inherits:
-
Object
- Object
- GeoEngineer::Output
- Defined in:
- lib/geoengineer/output.rb
Overview
Outputs are mapped 1:1 to terraform outputs
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(id, value, &block) ⇒ Output
constructor
A new instance of Output.
- #to_terraform ⇒ Object
- #to_terraform_json ⇒ Object
Constructor Details
#initialize(id, value, &block) ⇒ Output
Returns a new instance of Output.
9 10 11 12 |
# File 'lib/geoengineer/output.rb', line 9 def initialize(id, value, &block) @id = id @value = value end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/geoengineer/output.rb', line 7 def id @id end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
7 8 9 |
# File 'lib/geoengineer/output.rb', line 7 def value @value end |
Instance Method Details
#to_terraform ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/geoengineer/output.rb', line 18 def to_terraform sb = "" sb += "output #{@id.inspect} { " sb += "\n" sb += " value = #{@value.inspect}" sb += "\n" sb += " }" sb end |
#to_terraform_json ⇒ Object
14 15 16 |
# File 'lib/geoengineer/output.rb', line 14 def to_terraform_json { id: { value: value } } end |