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


447
448
449
# File 'lib/httpclient/session.rb', line 447

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

#closeObject


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

def close
  @socket.close
end

#closed?Boolean


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

def closed?
  @socket.closed?
end

#eof?Boolean


426
427
428
# File 'lib/httpclient/session.rb', line 426

def eof?
  @socket.eof?
end

#flushObject


451
452
453
# File 'lib/httpclient/session.rb', line 451

def flush
  @socket.flush
end

#gets(*args) ⇒ Object


430
431
432
# File 'lib/httpclient/session.rb', line 430

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

#initialize(socket, *args) ⇒ Object


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

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

#read(*args) ⇒ Object


434
435
436
# File 'lib/httpclient/session.rb', line 434

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

#readpartial(*args) ⇒ Object


438
439
440
441
442
443
444
445
# File 'lib/httpclient/session.rb', line 438

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

#syncObject


455
456
457
# File 'lib/httpclient/session.rb', line 455

def sync
  @socket.sync
end

#sync=(sync) ⇒ Object


459
460
461
# File 'lib/httpclient/session.rb', line 459

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