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
454 455 456 |
# File 'lib/httpclient/session.rb', line 454 def <<(str) @socket << str end |
#close ⇒ Object
425 426 427 |
# File 'lib/httpclient/session.rb', line 425 def close @socket.close end |
#closed? ⇒ Boolean
429 430 431 |
# File 'lib/httpclient/session.rb', line 429 def closed? @socket.closed? end |
#eof? ⇒ Boolean
433 434 435 |
# File 'lib/httpclient/session.rb', line 433 def eof? @socket.eof? end |
#flush ⇒ Object
458 459 460 |
# File 'lib/httpclient/session.rb', line 458 def flush @socket.flush end |
#gets(*args) ⇒ Object
437 438 439 |
# File 'lib/httpclient/session.rb', line 437 def gets(*args) @socket.gets(*args) end |
#initialize(socket, *args) ⇒ Object
420 421 422 423 |
# File 'lib/httpclient/session.rb', line 420 def initialize(socket, *args) super(*args) @socket = socket end |
#read(*args) ⇒ Object
441 442 443 |
# File 'lib/httpclient/session.rb', line 441 def read(*args) @socket.read(*args) end |
#readpartial(*args) ⇒ Object
445 446 447 448 449 450 451 452 |
# File 'lib/httpclient/session.rb', line 445 def readpartial(*args) # StringIO doesn't support :readpartial if @socket.respond_to?(:readpartial) @socket.readpartial(*args) else @socket.read(*args) end end |
#sync ⇒ Object
462 463 464 |
# File 'lib/httpclient/session.rb', line 462 def sync @socket.sync end |
#sync=(sync) ⇒ Object
466 467 468 |
# File 'lib/httpclient/session.rb', line 466 def sync=(sync) @socket.sync = sync end |