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

- (Interface) initialize(options = {})



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

- (Object) device

Returns the value of attribute device



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

def device
  @device
end

- (Object) mac

Returns the value of attribute mac



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

def mac
  @mac
end

- (Object) model

Returns the value of attribute model



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

def model
  @model
end

- (Object) network

Returns the value of attribute network



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

def network
  @network
end

- (Object) type

Returns the value of attribute type



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

def type
  @type
end

Instance Method Details

- (Boolean) new?



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

def new?
  mac.nil?
end