Class: Humidifier::Output

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

Overview

Represents a CFN stack output

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Output

Returns a new instance of Output.



6
7
8
9
10
# File 'lib/humidifier/output.rb', line 6

def initialize(opts = {})
  @description = opts[:description]
  @value       = opts[:value]
  @export_name = opts[:export_name]
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



4
5
6
# File 'lib/humidifier/output.rb', line 4

def description
  @description
end

#export_nameObject (readonly)

Returns the value of attribute export_name.



4
5
6
# File 'lib/humidifier/output.rb', line 4

def export_name
  @export_name
end

#valueObject (readonly)

Returns the value of attribute value.



4
5
6
# File 'lib/humidifier/output.rb', line 4

def value
  @value
end

Instance Method Details

#to_cfObject

CFN stack syntax



13
14
15
16
17
18
# File 'lib/humidifier/output.rb', line 13

def to_cf
  cf = { 'Value' => Serializer.dump(value) }
  cf['Description'] = description if description
  cf['Export'] = { 'Name' => export_name } if export_name
  cf
end