From: Aleks Kissinger Date: 2006-08-31T00:18:58+09:00 Subject: Re: Overriding Class Methods With Modules That works. So the final code would be something like: module TestExtension def inject_methods(base) base.module_eval do def self.my_method "overridden by TestExtension" end end end def extended(base) inject_methods(base) end def included(base) inject_methods(base) end end This has always been a little clunky in Ruby, primarily because methods written within a specific class were designed to override mixin and parent class methods, not vice-versa. On 8/30/06, Jan Svitok wrote: > On 8/30/06, John W. Long wrote: > > Trans wrote: > > > Okay a more presently practical answer. You can use a hack like: > > > > > > module TestExtension > > > def self.included(base) > > shouldn't be "extended" ? > > > > base.module_eval do > > > def my_method > > > "overridden by TestExtension" > > > end > > > end > > > end > > > def another_method > > > "another method" > > > end > > > end > > > > Mmm. That doesn't work either. > >