From: "Brian.LeRoux" Date: 2008-01-10T18:19:58+09:00 Subject: Re: how to remove a method from an object ? class Server attr_accessor :shh def initialize(f=false) @shh = f end def print if @shh self.send(:method_missing) else puts 'hi there' end end def method_missing puts 'I look forward to seeing better ways of doing this!' end # end s = Server.new s.print s2 = Server.new(true) s2.print s.print On Jan 10, 12:32 am, Valerio Schiavoni wrote: > hello everyone, > > how can I remove a method from an object, without impacting future > instances of its class ? > > say: > > class Server >    def print >        puts 'hello' >    end > end > > s1 = Server.new > s1.print #this work > > #now remove print from s1 somehow.. > > s1.print #this should hit method_missing > > s2 = Server.new > s2.print # this should work fine as well... > > Thanks for any help