From: Logan Capaldo Date: 2005-10-09T04:36:44+09:00 Subject: Re: Method added hook On Oct 8, 2005, at 12:32 PM, Sylvain Joyeux wrote: >> I'm looking for a way to prevent the redefinition of a method. I'm >> able >> to check when a method is defined (redefining Module#method_added) >> but >> I'm unable to halt the new definition. I'm also unable to know if the >> method is already defined or not. >> > You can freeze the class to avoid having any redefinition on it: > MyClass.freeze > > This is not valid at method-level though > -- > Sylvain Joyeux > > Just out of curiosity does anyone know what happens if I do (class << MyClass; self; end).freeze ?