From: Hal Fulton Date: 2004-05-15T16:53:27+09:00 Subject: Re: changing class at runtime Ryan Paul wrote: > I'm trying to find a way to arbitrarily alter the class of an instance at > runtime. The documentation didn't appear to have any clues. > > Ultimately, I want to be able to do something like this: [snip] You can't do it in Ruby unless you use Mauricio's "evil" library. (He named it, I didn't) which has a #become method, a la Smalltalk. If it really is just one method you're concerned with, you could always redefine it. Ruby won't let you change the class of an object, but it will let you arbitrarily add/change/delete stuff in the object. Hal