Class: Puppet::Network::HTTP::RackREST::RackFile

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet/network/http/rack/rest.rb

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ RackFile

Returns a new instance of RackFile.



17
18
19
# File 'lib/puppet/network/http/rack/rest.rb', line 17

def initialize(file)
  @file = file
end

Instance Method Details

#closeObject



27
28
29
# File 'lib/puppet/network/http/rack/rest.rb', line 27

def close
  @file.close
end

#eachObject



21
22
23
24
25
# File 'lib/puppet/network/http/rack/rest.rb', line 21

def each
  while chunk = @file.read(CHUNK_SIZE)
    yield chunk
  end
end