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



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

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

#closeObject



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

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

#debug_dev=(debug_dev) ⇒ Object



361
362
363
# File 'lib/httpclient/session.rb', line 361

def debug_dev=(debug_dev)
  @debug_dev = debug_dev
end

#gets(rs) ⇒ Object



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

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

#read(size, buf = nil) ⇒ Object



376
377
378
379
380
# File 'lib/httpclient/session.rb', line 376

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

#readpartial(size, buf = nil) ⇒ Object



382
383
384
385
386
# File 'lib/httpclient/session.rb', line 382

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