Class: HTTPClient::LoopBackSocket

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

Overview

Dummy Socket for emulating loopback test.

Instance Method Summary collapse

Methods included from SocketWrap

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

Constructor Details

#initialize(host, port, response) ⇒ LoopBackSocket

Returns a new instance of LoopBackSocket.



408
409
410
411
412
# File 'lib/httpclient/session.rb', line 408

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

Instance Method Details

#<<(str) ⇒ Object



414
415
416
# File 'lib/httpclient/session.rb', line 414

def <<(str)
  # ignored
end

#peer_certObject



418
419
420
# File 'lib/httpclient/session.rb', line 418

def peer_cert
  nil
end