class ActiveSupport::HashWithIndifferentAccess
def update(*other_hashes, &block)
Experimental RBS support (using type sampling data from the type_fusion
project).
type ActiveSupport__HashWithIndifferentAccess_update_other_hashes = Array[Hash, ] | Array[Hash, site_name, String, description, String, type, String, url, String, image, String] | Array[Hash, sample, Hash, gem_name, String, gem_version, String, receiver, String, method_name, String, application_name, String, location, String, type_fusion_version, String, parameters, Array, Array, String, String, String, Array, String, String, String, Array, String, String, String, return_value, String] | Array[Hash, card, String, creator, String] | Array[Hash, site, NilClass, title, String, reverse, TrueClass, separator, String, description, String, keywords, String, canonical, String, noindex, TrueClass, og, Hash, site_name, String, description, String, type, String, url, String, image, String, twitter, Hash, card, String, creator, String] | Array[Hash, q, String, controller, String, action, String, gem, String, version, String] | Array[Hash, controller, String, action, String, gem, String, version, String, id, String] def update: (*ActiveSupport__HashWithIndifferentAccess_update_other_hashes other_hashes, ) -> Hash
This signature was generated using 16 samples from 3 applications.
hash_2['key'] = 12
hash_1[:key] = 10
keys follow the semantics of indifferent access:
in the receiver, and the value in +other_hash+. The rules for duplicated
by the result of invoking the block with the duplicated key, the value
When given a block, the value for duplicated keys will be determined
of the values end up in the receiver, but which one is unspecified.
If the argument is a regular hash with keys +:key+ and "key" only one
In either case the merge respects the semantics of indifferent access.
ActiveSupport::HashWithIndifferentAccess or a regular +Hash+.
The arguments can be either an
hash.update({ "a" => 1 }, { "b" => 2 }) # => { "a" => 1, "b" => 2 }
hash = ActiveSupport::HashWithIndifferentAccess.new
hash_1.update(hash_2) # => {"key"=>"New Value!"}
hash_2[:key] = 'New Value!'
hash_2 = ActiveSupport::HashWithIndifferentAccess.new
hash_1[:key] = 'value'
hash_1 = ActiveSupport::HashWithIndifferentAccess.new
Updates the receiver in-place, merging in the hashes passed as arguments:
def update(*other_hashes, &block) if other_hashes.size == 1 update_with_single_argument(other_hashes.first, block) else other_hashes.each do |other_hash| update_with_single_argument(other_hash, block) end end self end