hostname()
public
Extract the host part of the URI and unwrap
brackets for IPv6 addresses.
This method is the same as URI::Generic#host except brackets for IPv6 (and
future IP) addresses are removed.
uri = URI("http://[::1]/bar")
uri.hostname
uri.host
# File lib/uri/generic.rb, line 645
def hostname
v = self.host
/\A\[(.*)\]\z/ =~ v ? $1 : v
end