Class: VagrantWindows::Config::Windows

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-windows/config/windows.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeWindows

Returns a new instance of Windows.



11
12
13
14
15
# File 'lib/vagrant-windows/config/windows.rb', line 11

def initialize
  @halt_timeout        = UNSET_VALUE
  @halt_check_interval = UNSET_VALUE
  @set_work_network    = UNSET_VALUE
end

Instance Attribute Details

#halt_check_intervalObject

Returns the value of attribute halt_check_interval.



8
9
10
# File 'lib/vagrant-windows/config/windows.rb', line 8

def halt_check_interval
  @halt_check_interval
end

#halt_timeoutObject

Returns the value of attribute halt_timeout.



7
8
9
# File 'lib/vagrant-windows/config/windows.rb', line 7

def halt_timeout
  @halt_timeout
end

#set_work_networkObject

Returns the value of attribute set_work_network.



9
10
11
# File 'lib/vagrant-windows/config/windows.rb', line 9

def set_work_network
  @set_work_network
end

Instance Method Details

#finalize!Object



27
28
29
30
31
# File 'lib/vagrant-windows/config/windows.rb', line 27

def finalize!
  @halt_timeout = 30       if @halt_timeout == UNSET_VALUE
  @halt_check_interval = 1 if @halt_check_interval == UNSET_VALUE
  @set_work_network = false if @set_work_network == UNSET_VALUE
end

#validate(machine) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/vagrant-windows/config/windows.rb', line 17

def validate(machine)
  errors = []

  errors << "windows.halt_timeout cannot be nil."        if machine.config.windows.halt_timeout.nil?
  errors << "windows.halt_check_interval cannot be nil." if machine.config.windows.halt_check_interval.nil?

  errors << "windows.set_work_network cannot be nil." if machine.config.windows.set_work_network.nil?
  { "Windows Guest" => errors }
end