Method: Addressable::URI#default_port

Defined in:
lib/addressable/uri.rb

#default_portInteger

The default port for this URI’s scheme. This method will always returns the default port for the URI’s scheme regardless of the presence of an explicit port in the URI.

Returns:

  • (Integer)

    The default port.



1454
1455
1456
# File 'lib/addressable/uri.rb', line 1454

def default_port
  URI.port_mapping[self.scheme.strip.downcase] if self.scheme
end