Module: HTTPClient::SocketWrap
- Included in:
- DebugSocket, LoopBackSocket
- Defined in:
- lib/httpclient/session.rb
Overview
Wraps up a Socket for method interception.
Instance Method Summary collapse
- #<<(str) ⇒ Object
- #close ⇒ Object
- #closed? ⇒ Boolean
- #eof? ⇒ Boolean
- #flush ⇒ Object
- #gets(*args) ⇒ Object
- #initialize(socket, *args) ⇒ Object
- #read(*args) ⇒ Object
- #readpartial(*args) ⇒ Object
- #sync ⇒ Object
- #sync=(sync) ⇒ Object
Instance Method Details
#<<(str) ⇒ Object
452 453 454 |
# File 'lib/httpclient/session.rb', line 452 def <<(str) @socket << str end |
#close ⇒ Object
423 424 425 |
# File 'lib/httpclient/session.rb', line 423 def close @socket.close end |
#closed? ⇒ Boolean
427 428 429 |
# File 'lib/httpclient/session.rb', line 427 def closed? @socket.closed? end |
#eof? ⇒ Boolean
431 432 433 |
# File 'lib/httpclient/session.rb', line 431 def eof? @socket.eof? end |
#flush ⇒ Object
456 457 458 |
# File 'lib/httpclient/session.rb', line 456 def flush @socket.flush end |
#gets(*args) ⇒ Object
435 436 437 |
# File 'lib/httpclient/session.rb', line 435 def gets(*args) @socket.gets(*args) end |
#initialize(socket, *args) ⇒ Object
418 419 420 421 |
# File 'lib/httpclient/session.rb', line 418 def initialize(socket, *args) super(*args) @socket = socket end |
#read(*args) ⇒ Object
439 440 441 |
# File 'lib/httpclient/session.rb', line 439 def read(*args) @socket.read(*args) end |
#readpartial(*args) ⇒ Object
443 444 445 446 447 448 449 450 |
# File 'lib/httpclient/session.rb', line 443 def readpartial(*args) # StringIO doesn't support :readpartial if @socket.respond_to?(:readpartial) @socket.readpartial(*args) else @socket.read(*args) end end |
#sync ⇒ Object
460 461 462 |
# File 'lib/httpclient/session.rb', line 460 def sync @socket.sync end |
#sync=(sync) ⇒ Object
464 465 466 |
# File 'lib/httpclient/session.rb', line 464 def sync=(sync) @socket.sync = sync end |