Class: Virt::Interface

Inherits:
Object
  • Object
show all
Defined in:
lib/virt/interface.rb

Direct Known Subclasses

KVM::Interface, VMWare::Interface

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Interface

Returns a new instance of Interface.



5
6
7
8
9
10
11
12
# File 'lib/virt/interface.rb', line 5

def initialize options = {}
  @connection = Virt.connection
  @device     = options[:device] || default_device
  @type       = options[:type]   || default_type
  @model      = options[:model]  || default_model
  @mac        = options[:mac]
  @network    = options[:network]
end

Instance Attribute Details

#deviceObject

Returns the value of attribute device.



3
4
5
# File 'lib/virt/interface.rb', line 3

def device
  @device
end

#macObject

Returns the value of attribute mac.



3
4
5
# File 'lib/virt/interface.rb', line 3

def mac
  @mac
end

#modelObject

Returns the value of attribute model.



3
4
5
# File 'lib/virt/interface.rb', line 3

def model
  @model
end

#networkObject

Returns the value of attribute network.



3
4
5
# File 'lib/virt/interface.rb', line 3

def network
  @network
end

#typeObject

Returns the value of attribute type.



3
4
5
# File 'lib/virt/interface.rb', line 3

def type
  @type
end

Instance Method Details

#new?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/virt/interface.rb', line 14

def new?
  mac.nil?
end