diff options
Diffstat (limited to 'activesupport/lib/active_support/core_ext/hash/keys.rb')
-rw-r--r-- | activesupport/lib/active_support/core_ext/hash/keys.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/core_ext/hash/keys.rb b/activesupport/lib/active_support/core_ext/hash/keys.rb index 13081995b0..b4c451ace4 100644 --- a/activesupport/lib/active_support/core_ext/hash/keys.rb +++ b/activesupport/lib/active_support/core_ext/hash/keys.rb @@ -24,7 +24,7 @@ class Hash # Return a new hash with all keys converted to strings. # - # hash = { name: 'Rob', age: '28' } + # hash = { name: 'Rob', age: '28' } # # hash.stringify_keys # #=> { "name" => "Rob", "age" => "28" } @@ -44,7 +44,7 @@ class Hash # hash = { 'name' => 'Rob', 'age' => '28' } # # hash.symbolize_keys - # #=> { name: "Rob", age: "28" } + # #=> { name: "Rob", age: "28" } def symbolize_keys transform_keys{ |key| key.to_sym rescue key } end @@ -102,7 +102,7 @@ class Hash # This includes the keys from the root hash and from all # nested hashes. # - # hash = { person: { name: 'Rob', age: '28' } } + # hash = { person: { name: 'Rob', age: '28' } } # # hash.deep_stringify_keys # # => { "person" => { "name" => "Rob", "age" => "28" } } @@ -121,10 +121,10 @@ class Hash # they respond to +to_sym+. This includes the keys from the root hash # and from all nested hashes. # - # hash = { 'person' => { 'name' => 'Rob', 'age' => '28' } } + # hash = { 'person' => { 'name' => 'Rob', 'age' => '28' } } # # hash.deep_symbolize_keys - # # => { person: { name: "Rob", age: "28" } } + # # => { person: { name: "Rob", age: "28" } } def deep_symbolize_keys deep_transform_keys{ |key| key.to_sym rescue key } end |