Is there an easy way to reassign the hash to ruby as follows:
from
{:name => "foo", :value => "bar"}
in
{"foo" => "bar"}
Preferably in such a way as to simplify this operation when repeating over an array of this type of hashes:
from
[{:name => "foo", :value => "bar"}, {:name => "foo2", :value => "bar2"}]
in
{"foo" => "bar", "foo2" => "bar2"}
Thanks.
source
share