Class: VagrantPlugins::Harddisk::Config
- Inherits:
-
Object
- Object
- VagrantPlugins::Harddisk::Config
- Defined in:
- lib/vagrant-harddisk/config.rb
Instance Attribute Summary collapse
-
#disks ⇒ ???
A list of disk specifications.
Instance Method Summary collapse
- #finalize! ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
11 12 13 |
# File 'lib/vagrant-harddisk/config.rb', line 11 def initialize @disks = Hash[] end |
Instance Attribute Details
#disks ⇒ ???
A list of disk specifications.
9 10 11 |
# File 'lib/vagrant-harddisk/config.rb', line 9 def disks @disks end |
Instance Method Details
#finalize! ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/vagrant-harddisk/config.rb', line 15 def finalize! @disks.each do |name, disk| unless disk.key?(:size) raise Vagrant::Errors::VagrantError.new, "Harddisk '#{name}' is missing required attribute: 'size'" end unless disk.key?(:position) raise Vagrant::Errors::VagrantError.new, "Harddisk '#{name}' is missing required attribute: 'position'" end unless disk.key?(:mount_point) raise Vagrant::Errors::VagrantError.new, "Harddisk '#{name}' is missing required attribute: 'mount_point'" end unless disk.key?(:interface_type) disk[:interface_type] = 'sata' end end end |