Class: Vagrant::Config::Windows

Inherits:
Base
  • 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.



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

def initialize
  @winrm_user = 'vagrant'
  @winrm_password = 'vagrant'
  @halt_timeout = 30
  @halt_check_interval = 1
  @device = "e1000g"
end

Instance Attribute Details

#deviceObject

Returns the value of attribute device.



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

def device
  @device
end

#halt_check_intervalObject

Returns the value of attribute halt_check_interval.



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

def halt_check_interval
  @halt_check_interval
end

#halt_timeoutObject

Returns the value of attribute halt_timeout.



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

def halt_timeout
  @halt_timeout
end

#winrm_passwordObject

Returns the value of attribute winrm_password.



5
6
7
# File 'lib/vagrant-windows/config/windows.rb', line 5

def winrm_password
  @winrm_password
end

#winrm_userObject

Returns the value of attribute winrm_user.



4
5
6
# File 'lib/vagrant-windows/config/windows.rb', line 4

def winrm_user
  @winrm_user
end

Instance Method Details

#validate(env, errors) ⇒ Object



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

def validate(env, errors)
  [ :winrm_user, :winrm_password].each do |field|
    errors.add(I18n.t("vagrant.config.common.error_empty", :field => field)) if !instance_variable_get("@#{field}".to_sym)
  end
end