On Sat, 7 Jul 2001, Jim Freeze wrote:

> Hi:
> 
> I have a class that contains a class (possibly a list of classes).
> The container class can also be contained by an other class.
> Essentially, the classes are just used as fancy structs to
> collect data in.
> 
> The problem is, I want to copy objects and have unique instances
> of these objects. I can do this by modifying #dup in the parent class,
> but I would like it to be more automatic.

Here's a somewhat cheesy solution:

class Package
	def clone
		Marshal.load(Marshal.dump self)
	end
end