Class: HTTPClient::LoopBackSocket

Inherits:
Object
  • Object
show all
Includes:
SocketWrap
Defined in:
lib/httpclient.rb

Overview

HTTPClient::LoopBackSocket – dummy socket for dummy response

Instance Method Summary collapse

Methods included from SocketWrap

#close, #closed?, #eof?, #flush, #gets, #read, #sync, #sync=

Constructor Details

#initialize(host, port, response) ⇒ LoopBackSocket

Returns a new instance of LoopBackSocket.



1222
1223
1224
1225
1226
# File 'lib/httpclient.rb', line 1222

def initialize(host, port, response)
  super(StringIO.new(response))
  @host = host
  @port = port
end

Instance Method Details

#<<(str) ⇒ Object



1232
1233
1234
# File 'lib/httpclient.rb', line 1232

def <<(str)
  # ignored
end

#addrObject



1228
1229
1230
# File 'lib/httpclient.rb', line 1228

def addr
  [nil, @port, @host, @host]
end