From: Jim Freeze Date: 2007-03-20T22:01:06+09:00 Subject: Re: [ ruby-Bugs-9376 ] Marshal.dump shouldn't complain about singletons if the _dump method is defined On Mar 20, 2007, at 2:45 AM, Sylvain Joyeux wrote: >> |But what if that singleton class just contained a method that >> allowed >> |direct access to a variable, or a quick hack to mutate something, >> |should those methods make it so it cannot be dumped. Can't the >> |interpreter just assume we know what we are doing? >> I am not sure if we know what we are doing here. Dumping objects >> without singleton information may trigger serious problems, that can >> happen too easily. When I need to marshal an object that contains a simple singleton, I simply remove the singleton, marshal the object, transport the object, unmarshal it and finally, add back the singleton. This way, I don't have to implement any complicated dump or undump calls. Will this method work for you?