reusable_aspect_hack_example.rb

Path: examples/reusable_aspect_hack_example.rb
Last Update: Wed Mar 26 12:45:07 -0500 2008

Example demonstrating a hack for defining a reusable aspect in a module so that the aspect only gets created when the module is included by another module or class. Hacking like this defies the spirit of Aquarium‘s goal of being "intuitive", so I created a feature request 19122 to address this problem.

WARNING: put the "include …" statement at the END of the class declaration, as shown below. If you put the include statement at the beginning, as you normally wouuld for including a module, it won‘t advice any join points, because no methods will have been defined at that point!!

Required files

aquarium  

[Validate]