deep_dup()
Instance Public methods
Returns a deep copy of hash.
1 2 3 4 5 6 | hash = { a: { b: 'b' } } dup = hash.deep_dup dup[ :a ][ :c ] = 'c' hash[ :a ][ :c ] # => nil dup[ :a ][ :c ] # => "c" |
Returns a deep copy of hash.
1 2 3 4 5 6 | hash = { a: { b: 'b' } } dup = hash.deep_dup dup[ :a ][ :c ] = 'c' hash[ :a ][ :c ] # => nil dup[ :a ][ :c ] # => "c" |
Designed by : w10schools
service@w10schools.com
Please login to continue.