class Fog::Compute::Vsphere::Interface

Public Class Methods

new(attributes={} ) click to toggle source
Calls superclass method Fog::Model::new
# File lib/fog/vsphere/models/compute/interface.rb, line 17
def initialize(attributes={} )
  if attributes.has_key? :type and attributes[:type].is_a? String then
     attributes[:type]=Fog.class_from_string(attributes[:type], "RbVmomi::VIM")
  end
  super defaults.merge(attributes)
end

Public Instance Methods

to_s() click to toggle source
# File lib/fog/vsphere/models/compute/interface.rb, line 24
def to_s
  name
end

Private Instance Methods

defaults() click to toggle source
# File lib/fog/vsphere/models/compute/interface.rb, line 30
def defaults
  default_type=Fog.credentials[:default_nic_type] || RbVmomi::VIM::VirtualE1000
  {
    :name=>"Network adapter",
    :network=>"VM Network",
    :summary=>"VM Network",
    :type=> Fog.class_from_string(default_type, "RbVmomi::VIM"),
  }
end