instance method
deep_dup
Ruby on Rails 4.0.13
Since v4.0.13Signature
deep_dup()
Returns a deep copy of array.
array = [1, [2, 3]] dup = array.deep_dup dup[1][2] = 4 array[1][2] #=> nil dup[1][2] #=> 4
Source
# File activesupport/lib/active_support/core_ext/object/deep_dup.rb, line 27
def deep_dup
map { |it| it.deep_dup }
end
Defined in activesupport/lib/active_support/core_ext/object/deep_dup.rb line 27
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Array