instance method
stringify_keys
Ruby on Rails 4.0.13
Since v3.0.20Signature
stringify_keys()
Return a new hash with all keys converted to strings.
hash = { name: 'Rob', age: '28' } hash.stringify_keys #=> { "name" => "Rob", "age" => "28" }
Source
# File activesupport/lib/active_support/core_ext/hash/keys.rb, line 31
def stringify_keys
transform_keys{ |key| key.to_s }
end
Defined in activesupport/lib/active_support/core_ext/hash/keys.rb line 31
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Hash