From: Christoph (news_chr) Date: 2003-06-15T23:26:48+09:00 Subject: Re: How to remove a singleton method from within an instance method? "Hal E. Fulton" wrote in .... > I can easily define a singleton from > within an instance method, but I can't > seem to get rid of it. See below. > > Even calling private would be OK... but > I can't figure that out either. Besides Guys solution I'd probably would do this class MyClass def get_ride_of_me(sym) class << self; self end.\ # overcome remove beign private ... __send__(:remove_method,sym.to_s) end def add_me def self.pingo p "pingo" end end end t =MyClass.new t.add_me t.pingo # pingo t.get_ride_of_me(:pingo) t.pingo # no MethodError > I'll explain why I want to, if someone > can figure out how. :) Okay we are waiting;-) /Christoph