From: Gene Tani Date: 2005-10-11T05:16:52+09:00 Subject: Re: Method added hook oops, I was just repeating what ES said. Maybe some combination of freeze and making your class un-subclassable and your method un-sendable, so that your privates don't get turned public. > I can always override dup to freeze the duplicated object. Is it right? > can I break other things in the Ruby library? > > > Besides, you can dup a frozen object and alter it (but clone gives you > > a still frozen object) > > > > class Foo > > def bar > > print "bar" > > end > > end > > > > Foo.freeze > > Foo2=Foo.dup > > > > class Foo2 > > def Foo2.bar > > print "bar in Foo2" > > end > > end > > p Foo2.bar > > > > > > > > I've tried it, but there is no unfreeze method :S. And I need to be > > > able to halt the redefinition SOME TIMES and some times NOT.