class HTTPClient::Util::AddressableURI

Public Instance Methods

authority() click to toggle source

Overwrites the original definition just for one line…

# File lib/httpclient/util.rb, line 65
def authority
  self.host && @authority ||= (begin
    authority = ""
    if self.userinfo != nil
      authority << "#{self.userinfo}@"
    end
    authority << self.host
    if self.port != self.default_port # ...HERE! Compares with default_port because self.port is not nil in this wrapper.
      authority << ":#{self.port}"
    end
    authority
  end)
end
hostname() click to toggle source

Captured from uri/generic.rb

# File lib/httpclient/util.rb, line 85
def hostname
  v = self.host
  /\A\[(.*)\]\z/ =~ v ? $1 : v
end
port() click to toggle source

HTTPClient expects urify(“foo/”).port to be not nil but 80 like URI.

Calls superclass method
# File lib/httpclient/util.rb, line 80
def port
  super || default_port
end