From: Ian Trudel Date: 2009-02-28T13:27:10+09:00 Subject: Re: Marshal.load does not create new instances? 7stud -- wrote: > How about something like this: > #program that loads the objects: > > def1 = <<-def1 > class MyData > def greet > puts "hello" > end > end > def1 Your solution seems great (and it works). However, my problem with it is the necessity to load and eval a class from a heredoc. It would be fine as long as it is small classes but it won't cut it for lengthy and numerous classes. I am afraid that it will make development and testing cycle somehow harder, if only for the fact that I won't have the support of my favourite IDE since it is treated as text. I was hoping to have an object-oriented solution, for example, where I could have a proxy, forwarder/delegator, or even subclass delegation. These actually did work as long as I don't Marshal.load. Your neat trick with heredoc and eval would be better used for smaller needs, I think. Any more suggestion? -- Posted via http://www.ruby-forum.com/.