instance method
deep_symbolize_keys
Ruby on Rails 2.2.3
Since v2.2.3 Last seen in v2.2.3Signature
deep_symbolize_keys(hash)
Return a new hash with all keys and nested keys converted to symbols.
Parameters
-
hashreq
Source
# File activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb, line 207
def deep_symbolize_keys(hash)
hash.inject({}) { |result, (key, value)|
value = deep_symbolize_keys(value) if value.is_a? Hash
result[(key.to_sym rescue key) || key] = value
result
}
end
Defined in activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb line 207
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in I18n::Backend::Simple