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

Version Path
sevenwire-forgery-0.1.0 lib/extensions/hash.rb
sevenwire-forgery-0.2.0 lib/extensions/hash.rb
sevenwire-forgery-0.2.1 lib/extensions/hash.rb
sevenwire-forgery-0.2.2 lib/extensions/hash.rb
forgery-0.3.12 lib/forgery/extensions/hash.rb
forgery-0.3.11 lib/forgery/extensions/hash.rb
forgery-0.3.10 lib/forgery/extensions/hash.rb
forgery-0.3.9 lib/forgery/extensions/hash.rb
forgery-0.3.8 lib/forgery/extensions/hash.rb
forgery-0.3.7 lib/forgery/extensions/hash.rb
forgery-0.3.6 lib/forgery/extensions/hash.rb
forgery-0.3.5 lib/forgery/extensions/hash.rb
forgery-0.3.4 lib/forgery/extensions/hash.rb
forgery-0.3.3 lib/forgery/extensions/hash.rb
forgery-0.3.2 lib/forgery/extensions/hash.rb
forgery-0.3.1 lib/forgery/extensions/hash.rb
forgery-0.3.0 lib/forgery/extensions/hash.rb
forgery-0.2.2 lib/extensions/hash.rb