Class: OsCtl::ExportFS::Export

Inherits:
Object
  • Object
show all
Defined in:
lib/osctl/exportfs/export.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(export) ⇒ Export

Returns a new instance of Export.

Parameters:

  • export (Hash)

Options Hash (export):

  • :dir (String)
  • :as (String)
  • :host (String)
  • :options (String)


28
29
30
31
32
33
# File 'lib/osctl/exportfs/export.rb', line 28

def initialize(export)
  @dir = export[:dir]
  @as = export[:as] || export[:dir]
  @host = export[:host]
  @options = export[:options]
end

Instance Attribute Details

#asString (readonly)

Directory to export in the server namespace

Returns:

  • (String)


9
10
11
# File 'lib/osctl/exportfs/export.rb', line 9

def as
  @as
end

#dirString (readonly)

Directory to export from the host namespace

Returns:

  • (String)


5
6
7
# File 'lib/osctl/exportfs/export.rb', line 5

def dir
  @dir
end

#hostString (readonly)

Mask for hosts that can access this export

Returns:

  • (String)


13
14
15
# File 'lib/osctl/exportfs/export.rb', line 13

def host
  @host
end

#optionsString (readonly)

NFS options

Returns:

  • (String)


17
18
19
# File 'lib/osctl/exportfs/export.rb', line 17

def options
  @options
end

Class Method Details

.load(data) ⇒ Object



19
20
21
# File 'lib/osctl/exportfs/export.rb', line 19

def self.load(data)
  new(data.transform_keys(&:to_sym))
end

Instance Method Details

#dumpObject



35
36
37
38
39
40
41
42
# File 'lib/osctl/exportfs/export.rb', line 35

def dump
  {
    'dir' => dir,
    'as' => as,
    'host' => host,
    'options' => options
  }
end