Method: Wgit::Url#to_host

Defined in:
lib/wgit/url.rb

#to_hostWgit::Url? Also known as: host

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

Returns:

  • (Wgit::Url, nil)

    Containing just the host or nil.



405
406
407
408
# File 'lib/wgit/url.rb', line 405

def to_host
  host = @uri.host
  host ? Wgit::Url.new(host) : nil
end