From: kjana@...4lab.to (YANAGAWA Kazuhisa) Date: 2002-10-15T20:53:16+09:00 Subject: Re: final in ruby In message <200210141713.g9EHDrm03577@moulon.inra.fr> decoux@moulon.inra.fr writes: > >>>>> "A" == Austin Ziegler writes: > > A> I think that what he's wanting to do is freeze a method, not a whole > A> class... > > He just need to put the methods that he want protect in a module and then > freeze this module Then that does not reflect author's desire: module M def foo; p 0; end end M.freeze class Foo include M end Foo.new.foo #=> 0 class Foo def foo; p 1; end end Foo.new.foo #=> 1 Of course `def M.foo; ...; end' is rejected since that's a method definition on a frozen module, but Foo itself is still opened. -- kjana@dm4lab.to October 15, 2002 Slow and steady wins the race.