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.



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

def initialize(file)
  @file = file
end

Instance Method Details

#closeObject



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

def close
  @file.close
end

#eachObject



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

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