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



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

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

#closeObject



369
370
371
372
# File 'lib/httpclient/session.rb', line 369

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

#debug_dev=(debug_dev) ⇒ Object



365
366
367
# File 'lib/httpclient/session.rb', line 365

def debug_dev=(debug_dev)
  @debug_dev = debug_dev
end

#gets(rs) ⇒ Object



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

def gets(rs)
  str = super
  debug(str)
  str
end

#read(size, buf = nil) ⇒ Object



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

def read(size, buf = nil)
  str = super
  debug(str)
  str
end

#readpartial(size, buf = nil) ⇒ Object



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

def readpartial(size, buf = nil)
  str = super
  debug(str)
  str
end