I accidentally saved a Ruby hash to string in Ruby 1.9 by calling my_hash.to_s
which is equal to my_hash.inspect
. This gave me a string like this:
'{"foo"=>{"bar"=>"baz", "qux"=>"quux"}'
I now want to revert this back into a hash. How is this done?
I'm not looking for an explanation on other serialisation techniques, I know them. I just need a way to revert this back so I can save it the right way.