You can try overwrite initialize method from the module

module M

       def self.included(classname)
       classname.class_eval <<-EOS
       alias_method :old_initialize, :initialize
         def initialize
           old_initialize
           module_method
         end
       EOS
       end


       def module_method
               @words << "module_word"
       end
end

class C

       attr_reader :words

       def initialize
               @words =3D []
               @words << "class_word"
       end

       include M
end

Sandro
www.railsonwave.com


On Fri, May 2, 2008 at 7:32 AM, I=F1aki Baz Castillo <ibc / aliax.net> wrote:
> 2008/5/1, I=F1aki Baz Castillo <ibc / aliax.net>:
>
>
>  >  irb> c=3DC.new
>  >  irb> c.words
>  >  ["class_word", "module_word"]
>  >
>  >
>  >  Is it possible without adding "module_method()" in class C initialize=
 method?
>
>
>  Of course I could use inheritance and super method in "initialize()"
>  but in fact I need to include more than a module so inheritance
>  (single using "class < class") is not valid for me.
>
>
>  --
>  I=F1aki Baz Castillo
>  <ibc / aliax.net>
>



--=20
Go outside! The graphics are amazing!