Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/kintsugi/utils.rb

Overview

Copyright © 2021 Lightricks. All rights reserved. Created by Ben Yohay. frozen_string_literal: true

Instance Method Summary collapse

Instance Method Details

#deep_cloneArray

Provides a deep clone of ‘self`

Returns:



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/kintsugi/utils.rb', line 9

def deep_clone
  map do |value|
    begin
      value.deep_clone
    rescue NoMethodError
      value.clone
    end
  rescue NoMethodError
    value
  end
end