Module: CoreEx::TryDup

Defined in:
lib/core_ex/try_dup.rb

Overview

Some objects are dupable, some are not. So we define a version of dup (called try_dup) that returns self on the handful of classes that are not dupable. (imported from rake (rake_dup))

Instance Method Summary collapse

Instance Method Details

#try_dupObject

Duplicate an object if it can be duplicated. If it can not be cloned or duplicated, then just return the original object.



16
17
18
# File 'lib/core_ex/try_dup.rb', line 16

def try_dup
  self
end