Class: Hash

Inherits:
Object
  • Object
show all
Includes:
Expandable
Defined in:
lib/core_ext.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods included from Expandable

#expand

Instance Method Details

#deep_dupObject



65
66
67
68
69
70
71
72
73
74
75
# File 'lib/core_ext.rb', line 65

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