From: Trans Date: 2006-10-31T03:03:38+09:00 Subject: Re: how to reset and how to undefine a class Ross Bamford wrote: > On Mon, 2006-10-30 at 22:30 +0900, Trans wrote: > > Trans wrote: > > > Adriano Mitre wrote: > > > > > > > Besides, I would like to know how to undefine Song class, so that > > > > Song.new produce a NameError, i.e., behaving as if it were never > > > > defined. > > > > > > You can redefine a class entirely by giving it a new subclass. > > > > > > class Song < Object > > > end > > > > s/subclass/superclass/ > > I don't get it: > > class SomeClass < String > def ameth(a) > p a > end > end > > class SomeClass < Object > end > > SomeClass.new.ameth(10) > > > :w !ruby > -:7: superclass mismatch for class SomeClass (TypeError) Hmph.... Looks like Ruby changed this at some point. It used to be able to do that. T.