module HTTPClient::SocketWrap
Wraps up a Socket for method interception.
Public Class Methods
new(socket, *args)
click to toggle source
Calls superclass method
# File lib/httpclient/session.rb, line 299 def initialize(socket, *args) super(*args) @socket = socket end
Public Instance Methods
<<(str)
click to toggle source
# File lib/httpclient/session.rb, line 333 def <<(str) @socket << str end
close()
click to toggle source
# File lib/httpclient/session.rb, line 304 def close @socket.close end
closed?()
click to toggle source
# File lib/httpclient/session.rb, line 308 def closed? @socket.closed? end
eof?()
click to toggle source
# File lib/httpclient/session.rb, line 312 def eof? @socket.eof? end
flush()
click to toggle source
# File lib/httpclient/session.rb, line 337 def flush @socket.flush end
gets(rs)
click to toggle source
# File lib/httpclient/session.rb, line 316 def gets(rs) @socket.gets(rs) end
read(size, buf = nil)
click to toggle source
# File lib/httpclient/session.rb, line 320 def read(size, buf = nil) @socket.read(size, buf) end
readpartial(size, buf = nil)
click to toggle source
# File lib/httpclient/session.rb, line 324 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()
click to toggle source
# File lib/httpclient/session.rb, line 341 def sync @socket.sync end
sync=(sync)
click to toggle source
# File lib/httpclient/session.rb, line 345 def sync=(sync) @socket.sync = sync end