Class: HTTP::Response::Inflater
- Inherits:
-
Object
- Object
- HTTP::Response::Inflater
- Defined in:
- lib/http/response/inflater.rb
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
Instance Method Summary collapse
-
#initialize(connection) ⇒ Inflater
constructor
A new instance of Inflater.
- #readpartial(*args) ⇒ Object
Constructor Details
#initialize(connection) ⇒ Inflater
Returns a new instance of Inflater.
10 11 12 |
# File 'lib/http/response/inflater.rb', line 10 def initialize(connection) @connection = connection end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
8 9 10 |
# File 'lib/http/response/inflater.rb', line 8 def connection @connection end |
Instance Method Details
#readpartial(*args) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/http/response/inflater.rb', line 14 def readpartial(*args) chunk = @connection.readpartial(*args) if chunk chunk = zstream.inflate(chunk) elsif !zstream.closed? zstream.finish if zstream.total_in.positive? zstream.close end chunk end |