Permalink
Browse files

documents Hash#with_indifferent_access

  • Loading branch information...
1 parent 8d0fa40 commit a692e5b9709b7f9c88b38770e783ae4544abbd74 @fxn fxn committed Sep 12, 2009
Showing with 5 additions and 0 deletions.
  1. +5 −0 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

0 comments on commit a692e5b

Please sign in to comment.