Class: GeoEngineer::Output

Inherits:
Object
  • Object
show all
Defined in:
lib/geoengineer/output.rb

Overview

Outputs are mapped 1:1 to terraform outputs

Terraform Docs

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#idObject (readonly)

Returns the value of attribute id


7
8
9
# File 'lib/geoengineer/output.rb', line 7

def id
  @id
end

#valueObject (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_terraformObject


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_jsonObject


14
15
16
# File 'lib/geoengineer/output.rb', line 14

def to_terraform_json
  { id: { value: value } }
end