Represents a Site: protocol scheme, host String and port Number.
Host String.
Port number.
Protocol scheme.
Creates a new Site based on the given URI.
# File lib/httpclient/session.rb, line 38 def initialize(uri = nil) if uri @scheme = uri.scheme @host = uri.host @port = uri.port.to_i else @scheme = 'tcp' @host = '0.0.0.0' @port = 0 end end
Returns true is scheme, host and port are ‘==’
# File lib/httpclient/session.rb, line 56 def ==(rhs) (@scheme == rhs.scheme) and (@host == rhs.host) and (@port == rhs.port) end
Returns address String.
# File lib/httpclient/session.rb, line 51 def addr "#{@scheme}://#{@host}:#{@port.to_s}" end
Same as ==.
# File lib/httpclient/session.rb, line 61 def eql?(rhs) self == rhs end
Returns true if scheme, host and port of the given URI matches with this.
# File lib/httpclient/session.rb, line 74 def match(uri) (@scheme == uri.scheme) and (@host == uri.host) and (@port == uri.port.to_i) end