blob: aad4b61e16aacc440f216e7c445be1472c6ab580 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
|
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
ActiveSupport::HashWithIndifferentAccess.new_from_hash_copying_default(self)
end
end
|