v0.6.2
Added support methods to Hash:
Hash#deep_keysreturns all nested keys in a HashHash#deep_transform_keystransforms all nested keys in a HashHash#deep_transform_keys!transforms all nested keys in a Hash in placeHash#stringify_names!stringifies names in placeHash#symbolize_names!symbolizes names in place
Hash#symbolize_names and Hash#stringify_names now use Hash#deep_transform_keys
{ a: { b: 'c', d: 'e' }, f: 'g' }.deep_keys
# => [:a, :b, :d, :f]
{ a: { b: 'c', d: 'e' }, f: 'g' }.deep_transform_keys(&:to_s)
# => { "a" => { "b" => "c", "d" => "e" }, "f" => "g" }
hash = { a: { b: 'c', d: 'e' }, f: 'g' }
hash.deep_transform_keys!(&:to_s)
# => { "a" => { "b" => "c", "d" => "e" }, "f" => "g" }