I have the following
friends = [{ name: "Jack", attr1:"def", attr2:"def" }, { name: "Jill", attr1:"def", attr2:"def" }]
I want to convert the above representation into a hash of hashes like this
friends = { "Jack" => { attr1: "def", attr2:"def" }, "Jill" => { attr1: "def", attr2: "def" } }
Any elegant way of doing this in Ruby ?
1 Answer