Module: DeepClone::Extensions::Array

Defined in:
lib/deep_clone/extensions/array.rb

Instance Method Summary collapse

Instance Method Details

#__deep_clone__Array

Makes a deep copy of the array, deep copying every element inside the array.

Examples:

Get a deep copy of the array.

[ 1, 2, 3 ].__deep_clone__

Returns:

  • (Array)

    The deep copy of the array.



13
14
15
# File 'lib/deep_clone/extensions/array.rb', line 13

def __deep_clone__
  map { |value| value.__deep_clone__ }
end