Skip to content

Instantly share code, notes, and snippets.

@bchase
Last active August 29, 2015 14:00
Show Gist options
  • Save bchase/11387342 to your computer and use it in GitHub Desktop.
Save bchase/11387342 to your computer and use it in GitHub Desktop.
class Params < Hash
def initialize(qs)
parse_query_string!(qs)
end
def parse_query_string!(qs)
pairs = qs.split('&')
pairs.each do |pair|
key, value = *pair.split('=')
self[key] = value
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment