Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

documents Hash#with_indifferent_access

  • Loading branch information...
commit a692e5b9709b7f9c88b38770e783ae4544abbd74 1 parent 8d0fa40
Xavier Noria fxn authored
5 activesupport/lib/active_support/core_ext/hash/indifferent_access.rb
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.