Sha256: a9a133c7f9445d2cddf25aceaeb202a55a3157569967d0589fd2b6a8fee88d90
Contents?: true
Size: 524 Bytes
Versions: 15
Compression:
Stored size: 524 Bytes
Contents
module Dply module HashExt refine Hash do def deep_merge!(other_hash, &block) merge!(other_hash) do |key, this_val, other_val| if this_val.is_a?(Hash) && other_val.is_a?(Hash) this_val.deep_merge(other_val, &block) elsif block_given? block.call(key, this_val, other_val) else other_val end end end def deep_merge(other_hash, &block) dup.deep_merge!(other_hash, &block) end end end end
Version data entries
15 entries across 15 versions & 1 rubygems