Executing a mixin method at the end of a class definition
I have a Mix-in that reflects on the receiver class to generate some code. This means that I need to execute the class method at the end of the class definition, like in this trivially dumbed down example: module PrintMethods module ClassMethods def print_methods puts instance_methods end end def self.included(receiver) receiver.extend ClassMethods end end class Tester include PrintMethods def method_that_needs_to_print end print_methods end I'd like to have the mixin do this for me automatically, but I can't come up with a way. My first thought was to add receiver.print_methods to self