Method: Nodo::Client#initialize
- Defined in:
- lib/nodo/client.rb
#initialize(address, port = nil) ⇒ Client
Returns a new instance of Client.
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/nodo/client.rb', line 7 def initialize(address, port = nil) super(address, port) case address when UNIX_REGEXP @socket_type = 'unix' @socket_path = address.sub(UNIX_REGEXP, '') # Host header is required for HTTP/1.1 @address = 'localhost' @port = 80 else @socket_type = 'inet' end end |