Class: Fog::Compute::AWS::RouteTable
- Inherits:
-
Model
- Object
- Model
- Fog::Compute::AWS::RouteTable
- Defined in:
- lib/fog/aws/models/compute/route_table.rb
Instance Method Summary collapse
-
#destroy ⇒ Object
Remove an existing route table.
-
#initialize(attributes = {}) ⇒ RouteTable
constructor
A new instance of RouteTable.
-
#save ⇒ Object
Create a route table.
Constructor Details
#initialize(attributes = {}) ⇒ RouteTable
Returns a new instance of RouteTable.
15 16 17 |
# File 'lib/fog/aws/models/compute/route_table.rb', line 15 def initialize(attributes={}) super end |
Instance Method Details
#destroy ⇒ Object
Remove an existing route table
route_tables.destroy
Returns
True or false depending on the result
28 29 30 31 32 33 |
# File 'lib/fog/aws/models/compute/route_table.rb', line 28 def destroy requires :id service.delete_route_table(id) true end |
#save ⇒ Object
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.
45 46 47 48 49 50 51 52 |
# File 'lib/fog/aws/models/compute/route_table.rb', line 45 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 |