Method: Wgit::Url#to_domain

Defined in:
lib/wgit/url.rb

#to_domainWgit::Url? Also known as: domain

Returns a new Wgit::Url containing just the domain of this URL e.g. Given http://www.google.co.uk/about.html, google.co.uk is returned.

Returns:

  • (Wgit::Url, nil)

    Containing just the domain or nil.



428
429
430
431
# File 'lib/wgit/url.rb', line 428

def to_domain
  domain = @uri.domain
  domain ? Wgit::Url.new(domain) : nil
end