From: Sean O'Halpin Date: 2005-11-23T17:27:25+09:00 Subject: Re: pattern: auto-running module init code Hi Phil, You can also use super: class Bar def initialize(*args, &block) puts "in Bar" super end end class Foo < Bar def initialize(*args, &block) puts "in Foo" super end end f = Foo.new module Mod def initialize(*args, &block) puts "in Mod" super end end class Foo include Mod end f = Foo.new --- OUTPUT --- in Foo in Bar in Foo in Mod in Bar or Module.included class Bar def initialize(*args, &block) puts "in Bar" super end end class Foo < Bar def initialize(*args, &block) puts "in Foo" super end end module Mod def self.included(obj) puts "in Mod" end end class Foo include Mod end f = Foo.new --- OUTPUT --- in Mod in Foo in Bar but note the different order of initialization. With extend, you get to choose whether you extend ~before~ the super or ~after~. So you can have either extend before super = Foo, Mod, Bar (same as include + super) or extend after super = Foo, Bar, Mod. Whether this is a pro or a con is up to you to decide. My own preference in this case is to use include + super. Regards, Sean