instance method
deep_merge!
Ruby on Rails 6.1.7.10
Since v2.3.18Signature
deep_merge!(other_hash, &block)
Same as deep_merge, but modifies self.
Parameters
-
other_hashreq -
blockblock
Source
# File activesupport/lib/active_support/core_ext/hash/deep_merge.rb, line 23
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
Defined in activesupport/lib/active_support/core_ext/hash/deep_merge.rb line 23
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Hash