Class: SimpleDeploy::StackAttributeFormater

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_deploy/stack/stack_attribute_formater.rb

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ StackAttributeFormater

Returns a new instance of StackAttributeFormater.



4
5
6
7
8
9
10
# File 'lib/simple_deploy/stack/stack_attribute_formater.rb', line 4

def initialize(args)
  @config          = args[:config]
  @environment     = args[:environment]
  @main_attributes = args[:main_attributes]
  @region          = @config.region @environment
  @logger          = @config.logger
end

Instance Method Details

#updated_attributes(attributes) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/simple_deploy/stack/stack_attribute_formater.rb', line 12

def updated_attributes(attributes)
  @provided_attributes = attributes

  updates = []
  @provided_attributes.each do |attrhash|
    key = attrhash.keys.first
    if artifact_names.include? key
      url_hash = cloud_formation_url attrhash, @provided_attributes
      updates << url_hash
      @logger.info "Adding artifact attribute: #{url_hash}"
    end
  end
  @provided_attributes + updates
end