class Addressable::URI

def authority

Returns:
  • (String) - The authority component.
def authority
  self.host && @authority ||= (begin
    authority = ""
    if self.userinfo != nil
      authority << "#{self.userinfo}@"
    end
    authority << self.host
    if self.port != nil
      authority << ":#{self.port}"
    end
    authority
  end)
end