diff options
author | Xavier Noria <fxn@hashref.com> | 2009-09-12 15:06:00 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2009-09-12 15:06:00 +0200 |
commit | a692e5b9709b7f9c88b38770e783ae4544abbd74 (patch) | |
tree | c981fa069f9f36d942072329f7f5b967ef2eac5d /activesupport/lib/active_support/core_ext | |
parent | 8d0fa4054e1564a6592416e854742661406c5c28 (diff) | |
download | rails-a692e5b9709b7f9c88b38770e783ae4544abbd74.tar.gz rails-a692e5b9709b7f9c88b38770e783ae4544abbd74.tar.bz2 rails-a692e5b9709b7f9c88b38770e783ae4544abbd74.zip |
documents Hash#with_indifferent_access
Diffstat (limited to 'activesupport/lib/active_support/core_ext')
-rw-r--r-- | activesupport/lib/active_support/core_ext/hash/indifferent_access.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/hash/indifferent_access.rb b/activesupport/lib/active_support/core_ext/hash/indifferent_access.rb index b30e1602b6..0420e206af 100644 --- a/activesupport/lib/active_support/core_ext/hash/indifferent_access.rb +++ b/activesupport/lib/active_support/core_ext/hash/indifferent_access.rb @@ -1,6 +1,11 @@ require 'active_support/hash_with_indifferent_access' class Hash + + # Returns an +ActiveSupport::HashWithIndifferentAccess+ out of its receiver: + # + # {:a => 1}.with_indifferent_access["a"] # => 1 + # def with_indifferent_access hash = ActiveSupport::HashWithIndifferentAccess.new(self) hash.default = self.default |