########################################################################## Mixin for creating easily cloned objects.
Methods
Public Instance methods
Clone an object by making a new object and setting all the instance variables to the same values.
This method is also aliased as
dup
[ show source ]
# File lib/rake.rb, line 269
269: def clone
270: sibling = self.class.new
271: instance_variables.each do |ivar|
272: value = self.instance_variable_get(ivar)
273: new_value = value.clone rescue value
274: sibling.instance_variable_set(ivar, new_value)
275: end
276: sibling
277: end
Alias for clone