Class: OsCtl::ExportFS::Config::Nfsd
- Inherits:
-
Object
- Object
- OsCtl::ExportFS::Config::Nfsd
- Defined in:
- lib/osctl/exportfs/config/nfsd.rb
Constant Summary collapse
- VERSIONS =
%w[3 4 4.0 4.1 4.2].freeze
Instance Attribute Summary collapse
- #nproc ⇒ Integer
- #port ⇒ Integer?
- #syslog ⇒ Boolean
- #tcp ⇒ Boolean
- #udp ⇒ Boolean
- #versions ⇒ Array<String>
Instance Method Summary collapse
- #allowed_versions ⇒ Array<String>
- #disallowed_versions ⇒ Array<String>
- #dump ⇒ Object
-
#initialize(cfg) ⇒ Nfsd
constructor
A new instance of Nfsd.
Constructor Details
#initialize(cfg) ⇒ Nfsd
Returns a new instance of Nfsd.
23 24 25 26 27 28 29 30 |
# File 'lib/osctl/exportfs/config/nfsd.rb', line 23 def initialize(cfg) @port = cfg['port'] @nproc = cfg['nproc'] || 8 @tcp = cfg['tcp'].nil? ? true : cfg['tcp'] @udp = cfg['udp'].nil? ? false : cfg['udp'] @versions = cfg['versions'] || ['3'] @syslog = cfg['syslog'].nil? ? false : cfg['syslog'] end |
Instance Attribute Details
#nproc ⇒ Integer
9 10 11 |
# File 'lib/osctl/exportfs/config/nfsd.rb', line 9 def nproc @nproc end |
#port ⇒ Integer?
6 7 8 |
# File 'lib/osctl/exportfs/config/nfsd.rb', line 6 def port @port end |
#syslog ⇒ Boolean
21 22 23 |
# File 'lib/osctl/exportfs/config/nfsd.rb', line 21 def syslog @syslog end |
#tcp ⇒ Boolean
12 13 14 |
# File 'lib/osctl/exportfs/config/nfsd.rb', line 12 def tcp @tcp end |
#udp ⇒ Boolean
15 16 17 |
# File 'lib/osctl/exportfs/config/nfsd.rb', line 15 def udp @udp end |
#versions ⇒ Array<String>
18 19 20 |
# File 'lib/osctl/exportfs/config/nfsd.rb', line 18 def versions @versions end |
Instance Method Details
#allowed_versions ⇒ Array<String>
44 45 46 |
# File 'lib/osctl/exportfs/config/nfsd.rb', line 44 def allowed_versions versions end |
#disallowed_versions ⇒ Array<String>
49 50 51 |
# File 'lib/osctl/exportfs/config/nfsd.rb', line 49 def disallowed_versions VERSIONS - allowed_versions end |
#dump ⇒ Object
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/osctl/exportfs/config/nfsd.rb', line 32 def dump { 'port' => port, 'nproc' => nproc, 'tcp' => tcp, 'udp' => udp, 'versions' => versions, 'syslog' => syslog } end |