From: Ryan Davis Date: 2013-08-01T06:25:36+09:00 Subject: Re: Method tracker - Need assistance On Jul 31, 2013, at 13:44 , Kenny Meyer wrote: > I would like to write an includable method tracker, which logs about added methods to a class. > > module MethodTracker > def self.method_added(method_name) > puts "Tracking #{method_name}" > end > end > > class Factory > include MethodTracker > > def build > end > end > > This is my code, however when the `Factory` class is defined there is no message shown. Can you give me a hint? method_added is a class method, so you need to extend Factory, not include. module MethodTracker def method_added(method_name) puts "Tracking #{method_name}" end end class Factory extend MethodTracker def build end end