Class: Vagrant::VMInfo

Inherits:
Object
  • Object
show all
Includes:
Util
Defined in:
lib/vagrant/vm_info.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uuid) ⇒ VMInfo

Returns a new instance of VMInfo.



10
11
12
13
14
# File 'lib/vagrant/vm_info.rb', line 10

def initialize(uuid)
  driver = Driver::VirtualBox.new
  self.raw = driver.execute("showvminfo", uuid)
  process!
end

Instance Attribute Details

#guest_osObject

Returns the value of attribute guest_os.



8
9
10
# File 'lib/vagrant/vm_info.rb', line 8

def guest_os
  @guest_os
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/vagrant/vm_info.rb', line 7

def name
  @name
end

#rawObject

Returns the value of attribute raw.



5
6
7
# File 'lib/vagrant/vm_info.rb', line 5

def raw
  @raw
end

#uuidObject

Returns the value of attribute uuid.



6
7
8
# File 'lib/vagrant/vm_info.rb', line 6

def uuid
  @uuid
end

Instance Method Details

#inspectObject

Public - Override inspect to display vm attributes



19
20
21
# File 'lib/vagrant/vm_info.rb', line 19

def inspect
  "#{uuid}: #{name} (#{guest_os})"
end