class Fog::Compute::OpenStack::Flavor

Public Class Methods

new(attributes) click to toggle source
Calls superclass method Fog::Model.new
# File lib/fog/openstack/models/compute/flavor.rb, line 18
def initialize(attributes)
  @connection = attributes[:connection]
  super
end

Public Instance Methods

destroy() click to toggle source
# File lib/fog/openstack/models/compute/flavor.rb, line 32
def destroy
  requires :id
  connection.delete_flavor(self.id)
  true
end
save() click to toggle source
# File lib/fog/openstack/models/compute/flavor.rb, line 23
def save
  requires :name, :ram, :vcpus, :disk
  attributes[:ephemeral] = self.ephemeral || 0
  attributes[:swap] = self.swap || 0
  attributes[:rxtx_factor] = self.rxtx_factor || 1
  merge_attributes(connection.create_flavor(self.attributes).body['flavor'])
  self
end