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



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

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

#closeObject



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

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

#debug_dev=(debug_dev) ⇒ Object



356
357
358
# File 'lib/httpclient/session.rb', line 356

def debug_dev=(debug_dev)
  @debug_dev = debug_dev
end

#gets(rs) ⇒ Object



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

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

#read(size, buf = nil) ⇒ Object



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

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

#readpartial(size, buf = nil) ⇒ Object



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

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