Class: VagrantWinNFSd::Config::WinNFSd
- Inherits:
-
Object
- Object
- VagrantWinNFSd::Config::WinNFSd
- Defined in:
- lib/vagrant-winnfsd/config/winnfsd.rb
Instance Attribute Summary collapse
-
#gid ⇒ Object
Returns the value of attribute gid.
-
#host_ip ⇒ Object
Returns the value of attribute host_ip.
-
#logging ⇒ Object
Returns the value of attribute logging.
-
#uid ⇒ Object
Returns the value of attribute uid.
Instance Method Summary collapse
- #finalize! ⇒ Object
-
#initialize ⇒ WinNFSd
constructor
A new instance of WinNFSd.
- #validate(machine) ⇒ Object
Constructor Details
#initialize ⇒ WinNFSd
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
#gid ⇒ Object
Returns the value of attribute gid.
8 9 10 |
# File 'lib/vagrant-winnfsd/config/winnfsd.rb', line 8 def gid @gid end |
#host_ip ⇒ Object
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 |
#logging ⇒ Object
Returns the value of attribute logging.
6 7 8 |
# File 'lib/vagrant-winnfsd/config/winnfsd.rb', line 6 def logging @logging end |
#uid ⇒ Object
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 |