Sha256: a920fc9076cb561cb88aef6029b46ed99a36b18e03a7f391de0e1c9a54f139ea
Contents?: true
Size: 395 Bytes
Versions: 48
Compression:
Stored size: 395 Bytes
Contents
# ********** Copyright 2016 Viacom, Inc. Apache 2.0 ********** class ::Hash def deep_merger merger = proc { |_key, v1, v2| Hash === v1 && Hash === v2 ? v1.merge(v2, &merger) : v2 } end def deep_merge(second) self.merge(second, &deep_merger) end def deep_merge!(second) self.merge!(second, &deep_merger) end def deep_dup Marshal.load(Marshal.dump(self)) end end
Version data entries
48 entries across 48 versions & 1 rubygems