Notes posted by mltsy
RSS feed
0 thanks
Works even on nested structures
@EdvardM added a note years ago saying this does not symbolize the keys of deeply nested hashes, which may have been the case for whatever version of ruby was available at the time, but in 4+, it definitely does work as described:
hash = {"a" => :a, "b" => {z: [[{"c" => 3}, {"c" => 4}], []]}} hash.deep_symbolize_keys => {:a=>:a, :b=>{:z=>[[{:c=>3}, {:c=>4}], []]}}