Last active
December 24, 2015 22:59
-
-
Save fijimunkii/6876812 to your computer and use it in GitHub Desktop.
ruby: params from scratch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
url = 'http://www.google.com/?q=123&y=2950&z=9500&p=950' | |
params = {} | |
query = url.split('?').pop | |
query.split('&').each do |x| y = x.split('='); params[y[0]] = y[1] end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment