Class: HTTP::Response::Inflater

Inherits:
Object
  • Object
show all
Defined in:
lib/http/response/inflater.rb

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ Inflater

Returns a new instance of Inflater.



8
9
10
# File 'lib/http/response/inflater.rb', line 8

def initialize(connection)
  @connection = connection
end

Instance Method Details

#readpartial(*args) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/http/response/inflater.rb', line 12

def readpartial(*args)
  chunk = @connection.readpartial(*args)
  if chunk
    chunk = zstream.inflate(chunk)
  elsif !zstream.closed?
    zstream.finish
    zstream.close
  end
  chunk
end