Module: HTTPClient::DebugSocket

Extended by:
SocketWrap
Defined in:
lib/httpclient/session.rb

Overview

Module for intercepting Socket methods and dumps in/out to given debugging device. debug_dev must respond to <<.

Instance Method Summary collapse

Methods included from SocketWrap

closed?, eof?, flush, initialize, sync, sync=

Instance Method Details

#<<(str) ⇒ Object



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

def <<(str)
  super
  debug(str)
end

#closeObject



436
437
438
439
# File 'lib/httpclient/session.rb', line 436

def close
  super
  debug("! CONNECTION CLOSED\n")
end

#debug_dev=(debug_dev) ⇒ Object



432
433
434
# File 'lib/httpclient/session.rb', line 432

def debug_dev=(debug_dev)
  @debug_dev = debug_dev
end

#gets(*args) ⇒ Object



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

def gets(*args)
  str = super
  debug(str)
  str
end

#read(*args) ⇒ Object



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

def read(*args)
  str = super
  debug(str)
  str
end

#readpartial(*args) ⇒ Object



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

def readpartial(*args)
  str = super
  debug(str)
  str
end