I just wrote a quick explanation with examples of the differences between copying and cloning a Ruby object. I've also added a quick explanation of shallow object copying.
Comments
AWESOME. I had no idea clone copied singleton class and dup didn't. That matters. If you submitted a doc patch to MRI to actually document this in Object#dup and Object#clone, that'd be super kind!jrochkind - August 01, 2012 00:23
Comments