From 8d0fa4054e1564a6592416e854742661406c5c28 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sat, 12 Sep 2009 15:05:12 +0200 Subject: AS guide: documents Hash#with_indifferent_access --- railties/guides/source/active_support_overview.textile | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'railties') 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: + + +{:a => 1}.with_indifferent_access["a"] # => 1 + + h3. Extensions to +Range+ ... -- cgit v1.2.3