From: Phillip Gawlowski Date: 2008-05-05T23:07:13+09:00 Subject: Re: Recursive dup -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I単aki Baz Castillo wrote: | I know that I should personalize "dup" method for class A, but is not | any other way? Does exist any automatic way of doing it? | I expect some method "dup_recursive" that looks for objects into | attributes recursively and clones them instead of reference. If your storage of objects can be enumerated, you could use .each, duplicate the objects you store, and re-store them. That doesn't seem terribly efficient, though, so proceed with caution (but it may get you started in the right direction :). - -- Phillip Gawlowski Twitter: twitter.com/cynicalryan Blog: http://justarubyist.blogspot.com Make sure comments and code agree. ~ - The Elements of Programming Style (Kernighan & Plaugher) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkgfFI4ACgkQbtAgaoJTgL9g/wCghdYgjUs5o0cNsmxItj8yHOT9 pKEAnAxds5jvXuulwEphsjRtCx1UFwCP =TiIJ -----END PGP SIGNATURE-----