Skip to content

Instantly share code, notes, and snippets.

@beepony
Created January 9, 2017 07:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beepony/44df9ab918155107ab536fdbfe9572b6 to your computer and use it in GitHub Desktop.
Save beepony/44df9ab918155107ab536fdbfe9572b6 to your computer and use it in GitHub Desktop.
convert json to hash in ruby
require 'json'
value = '{"val":"test","val1":"test1","val2":"test2"}'
puts JSON.parse(value) # => {"val"=>"test","val1"=>"test1","val2"=>"test2"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment