class HTTP::Response::Streamer

Public Class Methods

new(str) click to toggle source
# File lib/webmock/http_lib_adapters/http_rb/streamer.rb, line 4
def initialize(str)
  @io = StringIO.new str
end

Public Instance Methods

close() click to toggle source
# File lib/webmock/http_lib_adapters/http_rb/streamer.rb, line 20
def close
  @io.close
end
readpartial(size = nil, outbuf = nil) click to toggle source
# File lib/webmock/http_lib_adapters/http_rb/streamer.rb, line 8
def readpartial(size = nil, outbuf = nil)
  unless size
    if defined?(HTTP::Client::BUFFER_SIZE)
      size = HTTP::Client::BUFFER_SIZE
    elsif defined?(HTTP::Connection::BUFFER_SIZE)
      size = HTTP::Connection::BUFFER_SIZE
    end
  end

  @io.read size, outbuf
end
sequence_id() click to toggle source
# File lib/webmock/http_lib_adapters/http_rb/streamer.rb, line 24
def sequence_id
  -1
end