Class: CfFactory::CfRouteTable

Inherits:
Object
  • Object
show all
Includes:
CfBase
Defined in:
lib/cf_factory/vpc/cf_route_table.rb

Instance Method Summary collapse

Methods included from CfBase

#generate_ref, #get_deletion_policy, #get_name, #get_update_policy, #hash_to_string, #retrieve_attribute, #set_meta_data, #set_quotes, #set_tags

Constructor Details

#initialize(name) ⇒ CfRouteTable

Returns a new instance of CfRouteTable.



7
8
9
10
11
# File 'lib/cf_factory/vpc/cf_route_table.rb', line 7

def initialize(name)
  @name = name
  @vpc = ":::::"
  @routes = []
end

Instance Method Details

#add_route(route) ⇒ Object



13
14
15
16
# File 'lib/cf_factory/vpc/cf_route_table.rb', line 13

def add_route(route)
  route.set_route_table(self)
  @routes << route
end

#generateObject



34
35
36
37
38
39
40
# File 'lib/cf_factory/vpc/cf_route_table.rb', line 34

def generate
  super
  @routes.each() {|route|
    @result += route.generate
  } 
  @result
end

#get_cf_attributesObject



26
27
28
# File 'lib/cf_factory/vpc/cf_route_table.rb', line 26

def get_cf_attributes
  {}
end

#get_cf_propertiesObject



30
31
32
# File 'lib/cf_factory/vpc/cf_route_table.rb', line 30

def get_cf_properties
  {"VpcId" => @vpc.generate_ref}
end

#get_cf_typeObject



22
23
24
# File 'lib/cf_factory/vpc/cf_route_table.rb', line 22

def get_cf_type
  "AWS::EC2::RouteTable"
end

#set_vpc(vpc) ⇒ Object



18
19
20
# File 'lib/cf_factory/vpc/cf_route_table.rb', line 18

def set_vpc(vpc)
  @vpc = vpc
end