instance method
deep_merge!
Ruby on Rails 3.0.20
Since v2.3.18Signature
deep_merge!(other_hash)
Returns a new hash with self and other_hash merged recursively. Modifies the receiver in place.
Parameters
-
other_hashreq
Source
# File activesupport/lib/active_support/core_ext/hash/deep_merge.rb, line 9
def deep_merge!(other_hash)
other_hash.each_pair do |k,v|
tv = self[k]
self[k] = tv.is_a?(Hash) && v.is_a?(Hash) ? tv.deep_merge(v) : v
end
self
end
Defined in activesupport/lib/active_support/core_ext/hash/deep_merge.rb line 9
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Hash