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(rs) ⇒ Object
- #initialize(socket, *args) ⇒ Object
- #read(size, buf = nil) ⇒ Object
- #readpartial(size, buf = nil) ⇒ Object
- #sync ⇒ Object
- #sync=(sync) ⇒ Object
Instance Method Details
#<<(str) ⇒ Object
332 333 334 |
# File 'lib/httpclient/session.rb', line 332 def <<(str) @socket << str end |
#close ⇒ Object
303 304 305 |
# File 'lib/httpclient/session.rb', line 303 def close @socket.close end |
#closed? ⇒ Boolean
307 308 309 |
# File 'lib/httpclient/session.rb', line 307 def closed? @socket.closed? end |
#eof? ⇒ Boolean
311 312 313 |
# File 'lib/httpclient/session.rb', line 311 def eof? @socket.eof? end |
#flush ⇒ Object
336 337 338 |
# File 'lib/httpclient/session.rb', line 336 def flush @socket.flush end |
#gets(rs) ⇒ Object
315 316 317 |
# File 'lib/httpclient/session.rb', line 315 def gets(rs) @socket.gets(rs) end |
#initialize(socket, *args) ⇒ Object
298 299 300 301 |
# File 'lib/httpclient/session.rb', line 298 def initialize(socket, *args) super(*args) @socket = socket end |
#read(size, buf = nil) ⇒ Object
319 320 321 |
# File 'lib/httpclient/session.rb', line 319 def read(size, buf = nil) @socket.read(size, buf) end |
#readpartial(size, buf = nil) ⇒ Object
323 324 325 326 327 328 329 330 |
# File 'lib/httpclient/session.rb', line 323 def readpartial(size, buf = nil) # StringIO doesn't support :readpartial if @socket.respond_to?(:readpartial) @socket.readpartial(size, buf) else @socket.read(size, buf) end end |
#sync ⇒ Object
340 341 342 |
# File 'lib/httpclient/session.rb', line 340 def sync @socket.sync end |
#sync=(sync) ⇒ Object
344 345 346 |
# File 'lib/httpclient/session.rb', line 344 def sync=(sync) @socket.sync = sync end |