Skip to content

Instantly share code, notes, and snippets.

View dippysan's full-sized avatar

David Peterson dippysan

  • Vivitec Pty Ltd
View GitHub Profile
Given a url string, such as "http://www.google.com/search?q=kittens", write a method in ruby which returns a hash of the constituent parts of the URL. The hash should include the protocol, the subdomain(s), the domain, the path, and the query parameters.