Class: QEMU::Command::Disk
- Inherits:
-
Object
- Object
- QEMU::Command::Disk
- Defined in:
- lib/qemu/command.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
Returns the value of attribute file.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(file, options = {}) ⇒ Disk
constructor
A new instance of Disk.
- #qemu_drive(index) ⇒ Object
Constructor Details
#initialize(file, options = {}) ⇒ Disk
Returns a new instance of Disk.
31 32 33 34 |
# File 'lib/qemu/command.rb', line 31 def initialize(file, = {}) self.file = file self. = { :media => "disk" }.merge end |
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file.
29 30 31 |
# File 'lib/qemu/command.rb', line 29 def file @file end |
#options ⇒ Object
Returns the value of attribute options.
29 30 31 |
# File 'lib/qemu/command.rb', line 29 def @options end |
Instance Method Details
#qemu_drive(index) ⇒ Object
36 37 38 39 40 41 |
# File 'lib/qemu/command.rb', line 36 def qemu_drive(index) { :file => File.(file), :index => index, }.merge().map { |k,v| "#{k}=#{v}" }.join(',') end |