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

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

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ RackFile

Returns a new instance of RackFile.



14
15
16
# File 'lib/vendor/puppet/network/http/rack/rest.rb', line 14

def initialize(file)
  @file = file
end

Instance Method Details

#closeObject



24
25
26
# File 'lib/vendor/puppet/network/http/rack/rest.rb', line 24

def close
  @file.close
end

#eachObject



18
19
20
21
22
# File 'lib/vendor/puppet/network/http/rack/rest.rb', line 18

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