Class: Cfer::Core::Stack

Inherits:
Block
  • Object
show all
Defined in:
lib/stax/cfer.rb

Instance Method Summary collapse

Instance Method Details

#output(name, value, options = {}) ⇒ Object



26
27
28
29
30
# File 'lib/stax/cfer.rb', line 26

def output(name, value, options = {})
  opt = options.each_with_object({}) { |(k,v),h| h[k.to_s.capitalize] = v } # capitalize all keys
  export = opt.has_key?('Export') ? {'Name' => opt['Export']} : nil
  self[:Outputs][name] = opt.merge('Value' => value, 'Export' => export).compact
end