class DrawCloud::RouteTable

Attributes

name[RW]
routes[RW]

Public Class Methods

new(name, options={}, &block) click to toggle source
Calls superclass method DrawCloud::Base::new
# File lib/draw_cloud/route_table.rb, line 22
def initialize(name, options={}, &block)
  @name = name
  @routes = []
  super(options, &block)
end

Public Instance Methods

load_into_config(config) click to toggle source
Calls superclass method DrawCloud::Base#load_into_config
# File lib/draw_cloud/route_table.rb, line 37
def load_into_config(config)
  config.cf_add_resource resource_name, self
  @routes.each {|r| config.cf_add_resource(r.resource_name, r)}
  super(config)
end
resource_name() click to toggle source
# File lib/draw_cloud/route_table.rb, line 43
def resource_name
  resource_style(name) + "Table"
end
route_table() click to toggle source
# File lib/draw_cloud/route_table.rb, line 28
def route_table
  self
end
to(name, to_cidr, options={}) click to toggle source
# File lib/draw_cloud/route_table.rb, line 32
def to(name, to_cidr, options={})
  raise(Exeception, "No :via specified") unless options[:via]
  @routes << RouteTableEntry.new(name, to_cidr, options[:via], options.merge(:parent => self))
end
to_h() click to toggle source
# File lib/draw_cloud/route_table.rb, line 47
def to_h
  h = {
    "Type" => "AWS::EC2::RouteTable",
    "Properties" => {}
  }
  h["Properties"]["VpcId"] = DrawCloud.ref(vpc) if vpc
  add_standard_properties(h)
end