Class: ElasticAPM::Util::DeepDup Private

Inherits:
Object
  • Object
show all
Defined in:
lib/elastic_apm/util/deep_dup.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Makes a deep copy of an Array or Hash NB: Not guaranteed to work well with complex objects, only simple Hash, Array, String, Number, etc.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(obj) ⇒ DeepDup

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of DeepDup.



28
29
30
# File 'lib/elastic_apm/util/deep_dup.rb', line 28

def initialize(obj)
  @obj = obj
end

Class Method Details

.dup(obj) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



36
37
38
# File 'lib/elastic_apm/util/deep_dup.rb', line 36

def self.dup(obj)
  new(obj).dup
end

Instance Method Details

#dupObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



32
33
34
# File 'lib/elastic_apm/util/deep_dup.rb', line 32

def dup
  deep_dup(@obj)
end