module Nuggets::Hash::DeepMergeMixin

Public Instance Methods

deep_merge(other_hash) → aHash click to toggle source

Merges nested hashes recursively (see Hash#merge).

   # File lib/nuggets/hash/deep_merge_mixin.rb
35 def deep_merge(other)
36   merge(other) { |key, old, new|
37     old.respond_to?(:deep_merge) ? old.deep_merge(new) : new
38   }
39 end
deep_merge!(other_hash) → hash click to toggle source

Destructive version of deep_merge.

   # File lib/nuggets/hash/deep_merge_mixin.rb
45 def deep_merge!(other)
46   replace(deep_merge(other))
47 end
Also aliased as: deep_update
deep_update(other)
Alias for: deep_merge!