aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2009-09-12 15:06:00 +0200
committerXavier Noria <fxn@hashref.com>2009-09-12 15:06:00 +0200
commita692e5b9709b7f9c88b38770e783ae4544abbd74 (patch)
treec981fa069f9f36d942072329f7f5b967ef2eac5d /activesupport
parent8d0fa4054e1564a6592416e854742661406c5c28 (diff)
downloadrails-a692e5b9709b7f9c88b38770e783ae4544abbd74.tar.gz
rails-a692e5b9709b7f9c88b38770e783ae4544abbd74.tar.bz2
rails-a692e5b9709b7f9c88b38770e783ae4544abbd74.zip
documents Hash#with_indifferent_access
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/hash/indifferent_access.rb5
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