We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4d83c2a + 79b88e0 commit ccda54aCopy full SHA for ccda54a
activesupport/lib/active_support/core_ext/hash/keys.rb
@@ -27,7 +27,7 @@ def transform_keys!
27
# hash = { name: 'Rob', age: '28' }
28
#
29
# hash.stringify_keys
30
- # # => { "name" => "Rob", "age" => "28" }
+ # # => {"name"=>"Rob", "age"=>"28"}
31
def stringify_keys
32
transform_keys{ |key| key.to_s }
33
end
@@ -44,7 +44,7 @@ def stringify_keys!
44
# hash = { 'name' => 'Rob', 'age' => '28' }
45
46
# hash.symbolize_keys
47
- # # => { name: "Rob", age: "28" }
+ # # => {:name=>"Rob", :age=>"28"}
48
def symbolize_keys
49
transform_keys{ |key| key.to_sym rescue key }
50
0 commit comments