title: Ruby code to extract host from URL string
body: <p>I'm looking for a method to reliably extract the host name from a URL string in Ruby.</p>
  
  <p>e.g. 
  <a href="http://www.mglenn.com/directory" rel="noreferrer">http://www.mglenn.com/directory</a> = www.mglenn.com
  OR
  <a href="http://www.mglenn.com?param=x" rel="noreferrer">http://www.mglenn.com?param=x</a> = www.mglenn.com</p>