Making a Copy of an Object - Ruby

Saturday, April 19th, 2008

You want to make a copy of an existing object: a new object that can be modified separately from the original, Use Object#clone - makes a copy of the metaclass and instantiates the copy, instead of instantiating the object's original class example how to use clone : s1 = 'foo' ...