Sha256: 0cea370b518ccaec13b76eb9994f5fc91a3f5487fa7f5d73ee198bae8994dfc9
Contents?: true
Size: 407 Bytes
Versions: 8
Compression:
Stored size: 407 Bytes
Contents
module PactBroker module HashRefinements refine Hash do def deep_merge(other_hash, &block) block_actual = Proc.new {|key, oldval, newval| newval = block.call(key, oldval, newval) if block_given? [oldval, newval].all? {|v| v.is_a?(Hash)} ? oldval.merge(newval, &block_actual) : newval } merge(other_hash, &block_actual) end end end end
Version data entries
8 entries across 8 versions & 1 rubygems