aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2009-09-12 15:05:12 +0200
committerXavier Noria <fxn@hashref.com>2009-09-12 15:05:12 +0200
commit8d0fa4054e1564a6592416e854742661406c5c28 (patch)
tree942c4a31e6055e5da3ca109c31f7d172500e2d0e /railties
parentebe1775b78d14fb82fe7306e29e5085dd653f8c5 (diff)
downloadrails-8d0fa4054e1564a6592416e854742661406c5c28.tar.gz
rails-8d0fa4054e1564a6592416e854742661406c5c28.tar.bz2
rails-8d0fa4054e1564a6592416e854742661406c5c28.zip
AS guide: documents Hash#with_indifferent_access
Diffstat (limited to 'railties')
-rw-r--r--railties/guides/source/active_support_overview.textile8
1 files changed, 8 insertions, 0 deletions
diff --git a/railties/guides/source/active_support_overview.textile b/railties/guides/source/active_support_overview.textile
index 392640d239..3eae3f7421 100644
--- a/railties/guides/source/active_support_overview.textile
+++ b/railties/guides/source/active_support_overview.textile
@@ -1190,6 +1190,14 @@ params[:account] = params[:account].except(:plan_id) unless admin?
There's also the bang variant +except!+ that removes keys in the very receiver.
+h4. Indifferent Access
+
+The method +with_indifferent_access+ returns an +ActiveSupport::HashWithIndifferentAccess+ out of its receiver:
+
+<ruby>
+{:a => 1}.with_indifferent_access["a"] # => 1
+</ruby>
+
h3. Extensions to +Range+
...