Class: Hash

Inherits:
Object show all
Defined in:
lib/cocoapods-podspec-binary/mbuild/mbuild_hook.rb

Overview

Returns a deep copy of hash.

Instance Method Summary collapse

Instance Method Details

#deep_dupObject



41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/cocoapods-podspec-binary/mbuild/mbuild_hook.rb', line 41

def deep_dup
  hash = dup
  each_pair do |key, value|
    if key.is_a?(::String) || key.is_a?(::Symbol)
      hash[key] = value.deep_dup
    else
      hash.delete(key)
      hash[key.deep_dup] = value.deep_dup
    end
  end
  hash
end