Class: Async::HTTP::Faraday::BodyReadWrapper
- Inherits:
-
Protocol::HTTP::Body::Readable
- Object
- Protocol::HTTP::Body::Readable
- Async::HTTP::Faraday::BodyReadWrapper
- Defined in:
- lib/async/http/faraday/adapter.rb
Instance Method Summary collapse
- #close(error = nil) ⇒ Object
-
#initialize(body, block_size: 4096) ⇒ BodyReadWrapper
constructor
A new instance of BodyReadWrapper.
- #read ⇒ Object
Constructor Details
#initialize(body, block_size: 4096) ⇒ BodyReadWrapper
Returns a new instance of BodyReadWrapper.
22 23 24 25 |
# File 'lib/async/http/faraday/adapter.rb', line 22 def initialize(body, block_size: 4096) @body = body @block_size = block_size end |
Instance Method Details
#close(error = nil) ⇒ Object
27 28 29 30 31 |
# File 'lib/async/http/faraday/adapter.rb', line 27 def close(error = nil) @body.close if @body.respond_to?(:close) ensure super end |
#read ⇒ Object
33 34 35 |
# File 'lib/async/http/faraday/adapter.rb', line 33 def read @body.read(@block_size) end |