require 'json'
value="{"key_1":"value_1", "key_2":"value_2"}"
puts JSON.parse(value) # => {"key_1"=>"value_1","key_2"=>"value_2"}
More Related Contents:
- Why use symbols as hash keys in Ruby?
- Parsing a JSON string in Ruby
- How do I copy a hash in Ruby?
- The ‘json’ native gem requires installed build tools
- Best way to convert strings to symbols in hash
- Sort hash by key, return hash in Ruby
- How to convert a ruby hash object to JSON?
- How to merge Ruby hashes
- What is the best way to convert an array to a hash in Ruby
- Ruby send JSON request
- Ruby objects and JSON serialization (without Rails)
- How to convert Time format in ruby
- Regex for reverse match a string
- Why do Ruby setters need “self.” qualification within the class?
- Ruby, Difference between exec, system and %x() or Backticks
- Why does Ruby 1.9.2 remove “.” from LOAD_PATH, and what’s the alternative?
- rvm installation not working: “RVM is not a function”
- How to understand symbols in Ruby
- Ruby array access 2 consecutive(chained) elements at a time
- What does &. (ampersand dot) mean in Ruby?
- Should Gemfile.lock be included in .gitignore?
- Get names of all files from a folder with Ruby
- Unresolved specs during Gem::Specification.reset:
- How to convert a string to a constant in Ruby?
- What does the “||=” operand stand for in ruby [duplicate]
- Method to parse HTML document in Ruby?
- Really Cheap Command-Line Option Parsing in Ruby
- Running another ruby script from a ruby script
- ruby: class instance variables vs instance variables
- Is the &method(:method_name) idiom bad for performance in Ruby?