instance method
replace
Ruby on Rails 7.2.3
Since v4.0.13Signature
replace(other_hash)
Replaces the contents of this hash with other_hash.
h = { "a" => 100, "b" => 200 } h.replace({ "c" => 300, "d" => 400 }) # => {"c"=>300, "d"=>400}
Parameters
-
other_hashreq
Source
# File activesupport/lib/active_support/hash_with_indifferent_access.rb, line 296
def replace(other_hash)
super(self.class.new(other_hash))
end
Defined in activesupport/lib/active_support/hash_with_indifferent_access.rb line 296
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::HashWithIndifferentAccess