instance method replace

Ruby on Rails 4.0.13

Since v4.0.13 Last seen in v4.2.9

Available in: v4.0.13 v4.1.16 v4.2.9

Signature

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_hash req
Source
# File activesupport/lib/active_support/hash_with_indifferent_access.rb, line 212
    def replace(other_hash)
      super(self.class.new_from_hash_copying_default(other_hash))
    end

Defined in activesupport/lib/active_support/hash_with_indifferent_access.rb line 212 · View on GitHub · Improve this page · Find usages on GitHub

Defined in HashWithIndifferentAccess

Type at least 2 characters to search.

↑↓ navigate · open · esc close