Module: HTTPClient::SocketWrap

Included in:
DebugSocket, LoopBackSocket
Defined in:
lib/httpclient/session.rb

Overview

Wraps up a Socket for method interception.

Instance Method Summary collapse

Instance Method Details

#<<(str) ⇒ Object



409
410
411
# File 'lib/httpclient/session.rb', line 409

def <<(str)
  @socket << str
end

#closeObject



380
381
382
# File 'lib/httpclient/session.rb', line 380

def close
  @socket.close
end

#closed?Boolean



384
385
386
# File 'lib/httpclient/session.rb', line 384

def closed?
  @socket.closed?
end

#eof?Boolean



388
389
390
# File 'lib/httpclient/session.rb', line 388

def eof?
  @socket.eof?
end

#flushObject



413
414
415
# File 'lib/httpclient/session.rb', line 413

def flush
  @socket.flush
end

#gets(*args) ⇒ Object



392
393
394
# File 'lib/httpclient/session.rb', line 392

def gets(*args)
  @socket.gets(*args)
end

#initialize(socket, *args) ⇒ Object



375
376
377
378
# File 'lib/httpclient/session.rb', line 375

def initialize(socket, *args)
  super(*args)
  @socket = socket
end

#read(*args) ⇒ Object



396
397
398
# File 'lib/httpclient/session.rb', line 396

def read(*args)
  @socket.read(*args)
end

#readpartial(*args) ⇒ Object



400
401
402
403
404
405
406
407
# File 'lib/httpclient/session.rb', line 400

def readpartial(*args)
  # StringIO doesn't support :readpartial
  if @socket.respond_to?(:readpartial)
    @socket.readpartial(*args)
  else
    @socket.read(*args)
  end
end

#syncObject



417
418
419
# File 'lib/httpclient/session.rb', line 417

def sync
  @socket.sync
end

#sync=(sync) ⇒ Object



421
422
423
# File 'lib/httpclient/session.rb', line 421

def sync=(sync)
  @socket.sync = sync
end