From: Robert Klemme Date: 2004-04-01T17:09:31+09:00 Subject: Re: Silly question... "GGarramuno" schrieb im Newsbeitrag news:20040331173236.20738.00000341@mb-m19.aol.com... > > > >I don't think that's what the OP wanted. This seems to be more > >appropriate > > Indeed. remove_method and undef_method is what I want. > > Is there a particular reason there's no remove_instance_variable to match all > the other remove_ methods of Module? There is, but it's private: >> class Foo; attr_accessor :bar; end => nil >> f = Foo.new => # >> f.bar = "foo" => "foo" >> f => # >> f.remove_instance_variable :@bar NoMethodError: private method `remove_instance_variable' called for # from (irb):5 >> class Foo >> def rem(sym) >> remove_instance_variable sym >> end >> end => nil >> f.rem :@bar => "foo" >> f => # :-) robert