instance method
dup
Ruby on Rails edge
Since v3.0.20Signature
dup()
Returns a shallow copy of the hash.
“‘ hash = ActiveSupport::HashWithIndifferentAccess.new({ a: { b: ’b’ } }) dup = hash.dup dup[:c] = ‘c’
Source
# File activesupport/lib/active_support/hash_with_indifferent_access.rb, line 324
def dup
copy_defaults(self.class.new(self))
end
Defined in activesupport/lib/active_support/hash_with_indifferent_access.rb line 324
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::HashWithIndifferentAccess