In Files

  • lib/core_ex/try_dup.rb

Methods

CoreEx::TryDup

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))

Public Instance Methods

try_dup() click to toggle source

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

 
               # File lib/core_ex/try_dup.rb, line 16
def try_dup
  self
end