Class: GV::Valley::FileServer::FileSystem

Inherits:
Object
  • Object
show all
Defined in:
lib/gv/valley/file_server.rb

Constant Summary collapse

CHUNKSIZE =
65536

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ FileSystem

Returns a new instance of FileSystem.



18
19
20
# File 'lib/gv/valley/file_server.rb', line 18

def initialize(path)
  @path  = path
end

Instance Method Details

#getObject



22
23
24
25
26
# File 'lib/gv/valley/file_server.rb', line 22

def get
  open(@path, 'rb') do |file|
    yield file.read(CHUNKSIZE) until file.eof?
  end
end