From: gabriele renzi Date: 2004-03-31T18:29:22+09:00 Subject: Re: Silly question... il 31 Mar 2004 06:20:18 GMT, ggarramuno@aol.com (GGarramuno) ha scritto:: >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.... this works (with warnings) >> class A >> attr :t >> def initialize >> @t=1 >> end >> end => nil >> class B >> attr :x >> def initialize >> @x=3 >> end >> end => nil >> Object::const_set('A',B) (irb):13: warning: already initialized constant A => B >> A.new.t NoMethodError: undefined method `t' for # from (irb):14