Class: Fog::Compute::VirtualBox::NetworkAdapter

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

Instance Attribute Summary collapse

Attributes inherited from Model

#collection, #connection

Instance Method Summary collapse

Methods inherited from Model

#initialize, #inspect, #reload, #symbolize_keys, #to_json, #wait_for

Methods included from Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #requires, #requires_one

Constructor Details

This class inherits a constructor from Fog::Model

Instance Attribute Details

#machineObject

Returns the value of attribute machine.



28
29
30
# File 'lib/fog/virtual_box/models/compute/network_adapter.rb', line 28

def machine
  @machine
end

Instance Method Details

#nat_driverObject



42
43
44
45
46
47
48
49
# File 'lib/fog/virtual_box/models/compute/network_adapter.rb', line 42

def nat_driver
  Fog::Compute::VirtualBox::NATEngine.new(
    :connection       => connection,
    :machine          => machine,
    :network_adapter  => self,
    :raw              => raw.nat_driver
  )
end

#saveObject



30
31
32
33
34
35
36
37
38
39
# File 'lib/fog/virtual_box/models/compute/network_adapter.rb', line 30

def save
  with_session do |session|
    session_raw = session.machine.get_network_adapter(slot)
    # for attribute in [:adapter_type, :bandwidth_limit, :boot_priority, :cable_connected, :enabled, :host_interface, :internal_network, :line_speed, :mac_address, :nat_network, :trace_enabled, :trace_file]
    #   session_raw.send("#{attribute}=", attributes[attribute])
    # end
    session_raw.mac_address = mac_address
    session.machine.save_settings
  end
end