Module: Buff::Extensions::Hash::ReverseMerge

Included in:
Hash
Defined in:
lib/buff/extensions/hash/reverse_merge.rb

Instance Method Summary collapse

Instance Method Details

#reverse_merge(other) ⇒ Hash

Parameters:

Returns:


7
8
9
# File 'lib/buff/extensions/hash/reverse_merge.rb', line 7

def reverse_merge(other)
  other.merge(self)
end

#reverse_merge!(other) ⇒ Hash

Parameters:

Returns:


14
15
16
# File 'lib/buff/extensions/hash/reverse_merge.rb', line 14

def reverse_merge!(other)
  merge!(other) { |key, old, new| old }
end