Module: Libvirt::Spec::Device
- Defined in:
- lib/libvirt/spec/device.rb,
lib/libvirt/spec/device/disk.rb,
lib/libvirt/spec/device/input.rb,
lib/libvirt/spec/device/sound.rb,
lib/libvirt/spec/device/video.rb,
lib/libvirt/spec/device/emulator.rb,
lib/libvirt/spec/device/graphics.rb,
lib/libvirt/spec/device/interface.rb,
lib/libvirt/spec/device/video_model.rb
Defined Under Namespace
Classes: Disk, Emulator, Graphics, Input, Interface, Sound, Video, VideoModel
Class Method Summary collapse
-
.get(name) ⇒ Class
Returns the class of a device based on the name.
-
.load!(xml) ⇒ Device
Loads a device from an XML string.
Class Method Details
.get(name) ⇒ Class
Returns the class of a device based on the name. If
:disk
were given, for example, then a Disk class
would be returned. Note that since the class is returned,
and not an instance, it is up to the caller to instantiate
the returned class.
30 31 32 |
# File 'lib/libvirt/spec/device.rb', line 30 def self.get(name) const_get(name.to_s.capitalize) end |