Class: CfEc2Tag

Inherits:
Object
  • Object
show all
Includes:
CfInner
Defined in:
lib/cf_factory/base/cf_ec2_tag.rb

Instance Method Summary collapse

Methods included from CfInner

#additional_indent, #generate, #generate_name, #set_quotes

Constructor Details

#initialize(key, value, options = {}) ⇒ CfEc2Tag

Returns a new instance of CfEc2Tag.



6
7
8
9
10
# File 'lib/cf_factory/base/cf_ec2_tag.rb', line 6

def initialize(key, value, options = {})
  @key = key
  @value = value
  @propagate_at_launch = options[:propagate_at_launch]
end

Instance Method Details

#cloneObject



24
25
26
27
28
29
30
# File 'lib/cf_factory/base/cf_ec2_tag.rb', line 24

def clone
  options = {} 
  if @propagate_at_launch
    options[:propagate_at_launch] = @propagate_at_launch 
  end
  CfEc2Tag.new(@key,@value,options)
end

#get_cf_attributesObject



16
17
18
19
20
21
22
# File 'lib/cf_factory/base/cf_ec2_tag.rb', line 16

def get_cf_attributes
  result = {"Key" => @key,
   "Value" => @value
  }
  result["PropagateAtLaunch"] = @propagate_at_launch unless @propagate_at_launch.nil?
  result
end

#set_propagate_at_launch(pal) ⇒ Object



12
13
14
# File 'lib/cf_factory/base/cf_ec2_tag.rb', line 12

def set_propagate_at_launch(pal)
  @propagate_at_launch = pal
end