instance method
update
Ruby on Rails 2.3.18
Since v2.2.3 Last seen in v4.2.9Signature
update(other_hash)
Updates the instantized hash with values from the second:
hash_1 = HashWithIndifferentAccess.new hash_1[:key] = "value" hash_2 = HashWithIndifferentAccess.new hash_2[:key] = "New Value!" hash_1.update(hash_2) # => {"key"=>"New Value!"}
Parameters
-
other_hashreq
Source
# File activesupport/lib/active_support/core_ext/hash/indifferent_access.rb, line 45
def update(other_hash)
other_hash.each_pair { |key, value| regular_writer(convert_key(key), convert_value(value)) }
self
end
Defined in activesupport/lib/active_support/core_ext/hash/indifferent_access.rb line 45
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in HashWithIndifferentAccess