From: "Joel VanderWerf" <vjoel / PATH.Berkeley.EDU>


> >
> >>Take a look at Module#append_features.
> >
>
> OK, I see now. Why can't you just use initialize?
>
> module P
>    def initialize(*args)
>      super
>      puts "Initializing P"
>    end
> end
>
> class B
>    include P
> end
>
> a = B.new


You can, but why on earth do you think it will do what you want?

irb(main):001:0> module X
irb(main):002:1>   def initialize(y)
irb(main):003:2>     @y = y
irb(main):004:2>   end
irb(main):005:1> end
nil
irb(main):006:0> class Y
irb(main):007:1>   include X
irb(main):008:1> end
Y
irb(main):009:0> Y.new(6)
#<Y:0x1009b5c8 @y=6>

I'm not sending this to the list, because I may have misunderstood what you
want to do, and don't have time to fully investigate right now :)

Cheers,
Gavin