Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- lib/liquid/ext/hash.rb
Overview
Various Hash extensions.
Direct Known Subclasses
Instance Method Summary collapse
-
#delta_merge!(other_hash) ⇒ Object
accumulate existing keys from
other_hash
intoself
.
Instance Method Details
#delta_merge!(other_hash) ⇒ Object
accumulate existing keys from other_hash
into self
.
7 8 9 10 11 12 13 14 15 |
# File 'lib/liquid/ext/hash.rb', line 7 def delta_merge!(other_hash) other_hash.each do |k,v| if self.has_key?(k) self[k] += v else self[k] = v end end end |