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


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

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

#closeObject


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

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

#debug_dev=(debug_dev) ⇒ Object


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

def debug_dev=(debug_dev)
  @debug_dev = debug_dev
end

#gets(*args) ⇒ Object


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

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

#read(*args) ⇒ Object


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

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

#readpartial(*args) ⇒ Object


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

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