Class: Hash

Inherits:
Object show all
Defined in:
lib/core_ext/hash.rb

Direct Known Subclasses

Fixjour::OverridesHash

Instance Method Summary collapse

Instance Method Details

#make_indifferent!Object

Makes a hash able to be accessed via symbol or string keys.



3
4
5
6
7
8
# File 'lib/core_ext/hash.rb', line 3

def make_indifferent!
  keys_values = self.dup
  indifferent = Hash.new { |h,k| h[k.to_s] if Symbol === k }
  replace(indifferent)
  merge!(keys_values)
end