Class: NFS::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/nfs/server.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dir:, host:, port:, protocol:) ⇒ Server

Returns a new instance of Server.



5
6
7
8
9
10
11
12
13
# File 'lib/nfs/server.rb', line 5

def initialize(dir:, host:, port:, protocol:)
  @dir = dir
  @host = host
  @port = port
  @protocol = protocol

  @handler = Handler.new(FileProxy.open(dir))
  @server = server_class.new(@handler.programs, port, host)
end

Instance Attribute Details

#dirObject (readonly)

Returns the value of attribute dir.



3
4
5
# File 'lib/nfs/server.rb', line 3

def dir
  @dir
end

#hostObject (readonly)

Returns the value of attribute host.



3
4
5
# File 'lib/nfs/server.rb', line 3

def host
  @host
end

#portObject (readonly)

Returns the value of attribute port.



3
4
5
# File 'lib/nfs/server.rb', line 3

def port
  @port
end

#protocolObject (readonly)

Returns the value of attribute protocol.



3
4
5
# File 'lib/nfs/server.rb', line 3

def protocol
  @protocol
end

Instance Method Details

#joinObject



15
16
17
# File 'lib/nfs/server.rb', line 15

def join
  @server.join
end

#shutdownObject



23
24
25
# File 'lib/nfs/server.rb', line 23

def shutdown
  @server.shutdown
end

#startObject



19
20
21
# File 'lib/nfs/server.rb', line 19

def start
  @server.start
end