How to turn into back into a hash what is now a string of a hash?


I have this "hashed string" that I took from my Rails DB and I have to work with it as a hash. How do I make this

str = "{ H: 50, Q: 25, D: 10, N: 5, P: 1 }"

into this?

str = { H: 50, Q: 25, D: 10, N: 5, P: 1 }