class HTTPClient::Site

Represents a Site: protocol scheme, host String and port Number.

def ==(rhs)

Returns true is scheme, host and port are '=='
def ==(rhs)
  (@scheme == rhs.scheme) and (@host == rhs.host) and (@port == rhs.port)
end

def addr

Returns address String.
def addr
  "#{@scheme}://#{@host}:#{@port.to_s}"
end

def eql?(rhs)

Same as ==.
def eql?(rhs)
  self == rhs
end

def hash # :nodoc:

:nodoc:
def hash # :nodoc:
  [@scheme, @host, @port].hash
end

def initialize(uri = nil)

Creates a new Site based on the given URI.
def initialize(uri = nil)
  if uri
    @scheme = uri.scheme || 'tcp'
    @host = uri.hostname || '0.0.0.0'
    @port = uri.port.to_i
  else
    @scheme = 'tcp'
    @host = '0.0.0.0'
    @port = 0
  end
end

def inspect # :nodoc:

:nodoc:
def inspect # :nodoc:
  sprintf("#<%s:0x%x %s>", self.class.name, __id__, addr)
end

def match(uri)

Returns true if scheme, host and port of the given URI matches with this.
def match(uri)
  (@scheme == uri.scheme) and (@host == uri.host) and (@port == uri.port.to_i)
end

def to_s # :nodoc:

:nodoc:
def to_s # :nodoc:
  addr
end