Sha256: 0f5761fcfe28590697d2b87ef96ac0450a6af9c8d743f2be395c608a0cf4954c
Contents?: true
Size: 426 Bytes
Versions: 18
Compression:
Stored size: 426 Bytes
Contents
class Hash # Performs the opposite of merge, with the keys and values from the first hash taking precedence over the second. def reverse_merge(other_hash) other_hash.merge(self) end # Performs the opposite of merge, with the keys and values from the first hash taking precedence over the second. # Modifies the receiver in place. def reverse_merge!(other_hash) replace(reverse_merge(other_hash)) end end
Version data entries
18 entries across 18 versions & 2 rubygems