class Fog::Compute::IBM::Address

Constants

STATES

Public Class Methods

new(new_attributes={}) click to toggle source
Calls superclass method
# File lib/fog/ibm/models/compute/address.rb, line 31
def initialize(new_attributes={})
  super(new_attributes)
  self.offering_id ||= '20001223'
  self.location ||= '82'
end

Public Instance Methods

destroy() click to toggle source
# File lib/fog/ibm/models/compute/address.rb, line 54
def destroy
  requires :id
  service.delete_address(id).body['success']
end
ready?() click to toggle source
# File lib/fog/ibm/models/compute/address.rb, line 50
def ready?
  state == 'Free' || state == 'Released'
end
save() click to toggle source
# File lib/fog/ibm/models/compute/address.rb, line 37
def save
  requires :offering_id, :location
  data = service.create_address(location, offering_id,
                                   :vlan_id => vlan_id,
                                   :ip => ip)
  merge_attributes(data.body)
  true
end
state() click to toggle source
# File lib/fog/ibm/models/compute/address.rb, line 46
def state
  STATES[attributes[:state]]
end