aboutsummaryrefslogblamecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/hash/indifferent_access.rb
blob: aad4b61e16aacc440f216e7c445be1472c6ab580 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                     
 
          




                                                                              
                             
                                                                                
     
   
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