method
reverse_merge
v7.1.3.2 -
Show latest stable
- Class:
ActiveSupport::HashWithIndifferentAccess
reverse_merge(other_hash)public
Like merge but the other way around: Merges the receiver into the argument and returns a new hash with indifferent access as result:
hash = ActiveSupport::HashWithIndifferentAccess.new hash['a'] = nil hash.reverse_merge(a: 0, b: 1) # => {"a"=>nil, "b"=>1}