Method: ActiveSupport::DeepMergeable#deep_merge!
- Defined in:
- activesupport/lib/active_support/deep_mergeable.rb
#deep_merge!(other, &block) ⇒ Object
Same as #deep_merge, but modifies self
.
34 35 36 37 38 39 40 41 42 43 44 |
# File 'activesupport/lib/active_support/deep_mergeable.rb', line 34 def deep_merge!(other, &block) merge!(other) do |key, this_val, other_val| if this_val.is_a?(DeepMergeable) && this_val.deep_merge?(other_val) this_val.deep_merge(other_val, &block) elsif block_given? block.call(key, this_val, other_val) else other_val end end end |