From a692e5b9709b7f9c88b38770e783ae4544abbd74 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sat, 12 Sep 2009 15:06:00 +0200 Subject: documents Hash#with_indifferent_access --- activesupport/lib/active_support/core_ext/hash/indifferent_access.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'activesupport') 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 -- cgit v1.2.3