Class: VagrantPlugins::Dotvm::Injector::Network

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-dotvm/injector/network.rb

Constant Summary collapse

OPTIONS =
[
  :type,
  :ip,
  :netmask,
  :virtualbox__intnet,
  :guest,
  :host,
  :protocol,
  :bridge,
  :guest_ip,
  :host_ip,
  :auto_correct,
  :auto_config,
]

Class Method Summary collapse

Class Method Details

.inject(net: nil, machine: nil) ⇒ Object



20
21
22
23
24
25
26
27
28
29
# File 'lib/vagrant-dotvm/injector/network.rb', line 20

def self.inject(net: nil, machine: nil)
  hash = {}

  OPTIONS.each do |opt|
    val = net.send(opt)
    hash[opt] = val unless val.nil?
  end

  machine.vm.network net.net, **hash
end