Module: DataMapper::DeepCloning::Utilities::Hash

Defined in:
lib/data_mapper/deep_cloning/utilities.rb

Class Method Summary collapse

Class Method Details

.recursive_merge!(h1, h2) ⇒ Object



25
26
27
28
29
30
31
32
33
# File 'lib/data_mapper/deep_cloning/utilities.rb', line 25

def self.recursive_merge!(h1, h2)
  h1.merge!(h2) do |key, _old, _new|
    if _old.class == Hash
      recursive_merge!(_old, _new)
    else
      _new
    end
  end
end