require ‘multi_json‘
MultiJson.load(‘{"abc":"def"}‘) #=> {"abc" => "def"}
MultiJson.load(‘{"abc":"def"}‘, :symbolize_keys => true) #=> {:abc => "def"}
MultiJson.dump({:abc => ‘def‘}) # convert Ruby back to JSON
MultiJson.dump({:abc => ‘def‘}, :pretty => true) # encoded in a pretty form (if supported by the coder)
MultiJson.load(MultiJson.dump({:abc => ‘def‘}),:symbolize_keys => true)
json 转 hash(MultiJson),布布扣,bubuko.com
原文:http://www.cnblogs.com/qinyan20/p/3842950.html