From: Mike Harris Date: 2006-05-04T08:38:11+09:00 Subject: Re: mixin puzzle Obviously I modified more than the 2 modules. This is the best you're gonna do, cause I don't think extend has anything that can act as a "callback," ala append_features class Object alias_method :old_extend,:extend def extend(mod) include(mod) if self == X old_extend(mod) end end module N def foo "N#foo" end end module M include N end class X extend M end puts X.new.foo # N#foo -- Posted via http://www.ruby-forum.com/.