From: Daniel Sheppard Date: 2004-03-31T15:35:57+09:00 Subject: Re: Silly question... Run: A = Class.new To re-assign A to be a new, empty class. > -----Original Message----- > From: GGarramuno [mailto:ggarramuno@aol.com] > Sent: Wednesday, 31 March 2004 4:24 PM > To: ruby-talk ML > Subject: Silly question... > > > Is there any way of completely remove a class object's > methods instead of extending the class? > > I'd like to be able to do: > > class A > attr :t > def initialize > @t = 1 > end > end > > a = A.new > puts a.t # => 1 > > # Not extending... redefining here.... > class A > attr :x > def initialize > @x = 3 > end > end > > > a = A.new > puts a.x # => 3 > puts a.t # => error, instead of outputing nil > > I'm finding the above to be a major pain when debugging and > prototyping new code in either irb or an embedded ruby, every > time I reload a library. > > > ##################################################################################### This email has been scanned by MailMarshal, an email content filter. #####################################################################################