Method: HTTPX::Response::Buffer#initialize

Defined in:
lib/httpx/response/buffer.rb

#initialize(threshold_size:, bytesize: 0, encoding: Encoding::BINARY) ⇒ Buffer

initializes buffer with the threshold_size over which the payload gets buffer to a tempfile, the initial bytesize, and the encoding.



15
16
17
18
19
20
21
# File 'lib/httpx/response/buffer.rb', line 15

def initialize(threshold_size:, bytesize: 0, encoding: Encoding::BINARY)
  @threshold_size = threshold_size
  @bytesize = bytesize
  @encoding = encoding
  @buffer = StringIO.new("".b)
  super(@buffer)
end