Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dippysan/e9b1ae5560f4f5450eeb9b89c85eb2d5 to your computer and use it in GitHub Desktop.
Save dippysan/e9b1ae5560f4f5450eeb9b89c85eb2d5 to your computer and use it in GitHub Desktop.
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment