lib/humidifier/output.rb in humidifier-2.15.0 vs lib/humidifier/output.rb in humidifier-3.0.0
- old
+ new
@@ -1,22 +1,20 @@
# frozen_string_literal: true
module Humidifier
- # Represents a CFN stack output
class Output
attr_reader :description, :value, :export_name
def initialize(opts = {})
@description = opts[:description]
@value = opts[:value]
@export_name = opts[:export_name]
end
- # CFN stack syntax
def to_cf
- cf = { 'Value' => Serializer.dump(value) }
- cf['Description'] = description if description
- cf['Export'] = { 'Name' => export_name } if export_name
- cf
+ { 'Value' => Serializer.dump(value) }.tap do |cf|
+ cf['Description'] = description if description
+ cf['Export'] = { 'Name' => export_name } if export_name
+ end
end
end
end