Class: Fog::AWS::Compute::RouteTable

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/aws/models/compute/route_table.rb

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ RouteTable

Returns a new instance of RouteTable.



13
14
15
# File 'lib/fog/aws/models/compute/route_table.rb', line 13

def initialize(attributes={})
  super
end

Instance Method Details

#destroyObject

Remove an existing route table

route_tables.destroy

Returns

True or false depending on the result



26
27
28
29
30
31
# File 'lib/fog/aws/models/compute/route_table.rb', line 26

def destroy
  requires :id

  service.delete_route_table(id)
  true
end

#saveObject

Create a route table

>> routetable = connection.route_tables.new >> routetable.save

Returns:

True or an exception depending on the result. Keep in mind that this creates a new route table.



43
44
45
46
47
48
49
50
# File 'lib/fog/aws/models/compute/route_table.rb', line 43

def save
  requires :vpc_id

  data = service.create_route_table(vpc_id).body['routeTable'].first
  new_attributes = data.reject {|key,value| key == 'requestId'}
  merge_attributes(new_attributes)
  true
end