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
448 449 450 |
# File 'lib/httpclient/session.rb', line 448 def <<(str) @socket << str end |
#close ⇒ Object
419 420 421 |
# File 'lib/httpclient/session.rb', line 419 def close @socket.close end |
#closed? ⇒ Boolean
423 424 425 |
# File 'lib/httpclient/session.rb', line 423 def closed? @socket.closed? end |
#eof? ⇒ Boolean
427 428 429 |
# File 'lib/httpclient/session.rb', line 427 def eof? @socket.eof? end |
#flush ⇒ Object
452 453 454 |
# File 'lib/httpclient/session.rb', line 452 def flush @socket.flush end |
#gets(*args) ⇒ Object
431 432 433 |
# File 'lib/httpclient/session.rb', line 431 def gets(*args) @socket.gets(*args) end |
#initialize(socket, *args) ⇒ Object
414 415 416 417 |
# File 'lib/httpclient/session.rb', line 414 def initialize(socket, *args) super(*args) @socket = socket end |
#read(*args) ⇒ Object
435 436 437 |
# File 'lib/httpclient/session.rb', line 435 def read(*args) @socket.read(*args) end |
#readpartial(*args) ⇒ Object
439 440 441 442 443 444 445 446 |
# File 'lib/httpclient/session.rb', line 439 def readpartial(*args) # StringIO doesn't support :readpartial if @socket.respond_to?(:readpartial) @socket.readpartial(*args) else @socket.read(*args) end end |
#sync ⇒ Object
456 457 458 |
# File 'lib/httpclient/session.rb', line 456 def sync @socket.sync end |
#sync=(sync) ⇒ Object
460 461 462 |
# File 'lib/httpclient/session.rb', line 460 def sync=(sync) @socket.sync = sync end |