class Addressable::URI

def domain

Addressable::URI.parse("http://www.example.co.uk").domain # => "example.co.uk"
@example

Returns the public suffix domain for this host.
#
def domain
  PublicSuffix.domain(self.host, ignore_private: true)
end