From: Ian Trudel Date: 2009-03-06T18:45:44+09:00 Subject: Re: Marshal.load does not create new instances? Robert Klemme wrote: > 2009/2/28 Ian Trudel : >> Capitain! >> >> >> differences according to their version. I would like to be able to load >> >> Thanks for your help, guys! > > As Brian has hinted, you can use instance_variable_get etc. to access > variable values. You can even make it a bit more convenient (see > attached file for examples). > > Kind regards > > robert Hello, Robert! I was actually trying something along this line. My extended modules would however redefine attribute writers (see example below) for every and each instance variable, in order to be able to change value in the loaded class instances. This would allow me to change value and dump back the loaded data. Your example clearly and conveniently does not require to redefine manually every ivar but it won't let me dump anymore, reporting the error "singleton can't be dumped (TypeError)". def myvar=(data) self.instance_variable_set(:@myvar, data) end -- Posted via http://www.ruby-forum.com/.