From: Tim Hunter Date: 2006-05-23T01:20:39+09:00 Subject: Re: initializing instance variables in a module Jeff Rose wrote: > but just initializing on inclusion seems to be the most reasonable > way, doesn't it? > Put the initialization code in the module's initialize method and have every class that includes the module call super from its initialize method: module Foo def initialize(*args, &block) # whatever... end end class Bar include Foo def initialize(*args, &block) super # calls Foo's initialize # more stuff end end -- Posted via http://www.ruby-forum.com/.