Class: VagrantWinNFSd::Config::WinNFSd

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeWinNFSd

Returns a new instance of WinNFSd.



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

def initialize
  @logging = UNSET_VALUE
  @uid     = UNSET_VALUE
  @gid     = UNSET_VALUE
  @host_ip = UNSET_VALUE
end

Instance Attribute Details

#gidObject

Returns the value of attribute gid.



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

def gid
  @gid
end

#host_ipObject

Returns the value of attribute host_ip.



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

def host_ip
  @host_ip
end

#loggingObject

Returns the value of attribute logging.



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

def logging
  @logging
end

#uidObject

Returns the value of attribute uid.



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

def uid
  @uid
end

Instance Method Details

#finalize!Object



29
30
31
32
33
34
# File 'lib/vagrant-winnfsd/config/winnfsd.rb', line 29

def finalize!
  @logging = 'off'  if @logging == UNSET_VALUE
  @uid = 0          if @uid == UNSET_VALUE
  @gid = 0          if @gid == UNSET_VALUE
  @host_ip = ""     if @host_ip == UNSET_VALUE
end

#validate(machine) ⇒ Object



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

def validate(machine)
  errors = []

  errors << 'winnfsd.logging cannot only be \'on\' or \'off\'.' unless (machine.config.winnfsd.logging == 'on' || machine.config.winnfsd.logging == 'off')
  errors << 'winnfsd.uid cannot be nil.'                        if machine.config.winnfsd.uid.nil?
  errors << 'winnfsd.gid cannot be nil.'                        if machine.config.winnfsd.gid.nil?
  errors << 'winnfsd.host_ip cannot be nil.'                    if machine.config.winnfsd.host_ip.nil?

  { "WinNFSd" => errors }
end