Module: Searchgasm::CoreExt::Hash

Defined in:
lib/searchgasm/core_ext/hash.rb

Instance Method Summary collapse

Instance Method Details

#deep_dupObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/searchgasm/core_ext/hash.rb', line 4

def deep_dup
  new_hash = {}
  
  self.each do |k, v|
    case v
    when Hash
      new_hash[k] = v.deep_dup
    else
      new_hash[k] = v
    end
  end
  
  new_hash
end