instance method
symbolize_keys
Ruby on Rails 3.2.22.5
Since v3.0.20Signature
symbolize_keys()
Return a new hash with all keys converted to symbols, as long as they respond to to_sym.
{ 'name' => 'Rob', 'years' => '28' }.symbolize_keys
#=> { :name => "Rob", :years => "28" }
Source
# File activesupport/lib/active_support/core_ext/hash/keys.rb, line 24
def symbolize_keys
dup.symbolize_keys!
end
Defined in activesupport/lib/active_support/core_ext/hash/keys.rb line 24
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Hash