Mixin a module with initialize

I want to mixin a class, overwrite the initialize method, but I still
want to call the original initialize, how can I do this as simple as
class A def initialize #some code endend
module B def initialize #some way to call the original #some
other code endend
#then extend


Here’s a sketch of one approach:

In your module, you’ll need to override the module’s “self.included”
This gets passed the constant for the class you are being mixed into.

In the included hook, alias the original initialize to some other method
name. Then, create your own initialize method. In the new initialize
call the alias to the original initialize method.

2011/3/3 pp [email protected]