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


497
498
499
500
# File 'lib/httpclient/session.rb', line 497

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

#closeObject


474
475
476
477
# File 'lib/httpclient/session.rb', line 474

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

#debug_dev=(debug_dev) ⇒ Object


470
471
472
# File 'lib/httpclient/session.rb', line 470

def debug_dev=(debug_dev)
  @debug_dev = debug_dev
end

#gets(*args) ⇒ Object


479
480
481
482
483
# File 'lib/httpclient/session.rb', line 479

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

#read(*args) ⇒ Object


485
486
487
488
489
# File 'lib/httpclient/session.rb', line 485

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

#readpartial(*args) ⇒ Object


491
492
493
494
495
# File 'lib/httpclient/session.rb', line 491

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