class Addressable::URI

def hostname

Returns:
  • (String) - The hostname for this URI.

Other tags:
    See: Addressable::URI#host -
def hostname
  v = self.host
  /\A\[(.*)\]\z/ =~ v ? $1 : v
end