Skip to content

Instantly share code, notes, and snippets.

@soumyaray
Last active August 29, 2015 14:01
Show Gist options
  • Save soumyaray/66eb592056fb9fff45a1 to your computer and use it in GitHub Desktop.
Save soumyaray/66eb592056fb9fff45a1 to your computer and use it in GitHub Desktop.
require 'json'
hstr = ["name=ytutyu&email=tyutyu&bio=tyutyu"]
params = hstr[0].split(/\&/).reduce({}) do |all, p|
name, value = p.split(/=/)
all.merge(name => value)
end.to_json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment