From: Josh Cheek Date: 2010-12-31T02:04:58+09:00 Subject: Re: How to hook a callback through inheritance --0016361e7b0c2c00bf0498a399ab Content-Type: text/plain; charset=ISO-8859-1 The problem is that before_laughing is being invoked as a class method on Lol. So when you say "before_laughing :downcase_please", you aren't setting @before_laughing on instances of Lol, but rather on Lol itself. I suppose one way to do this is to leave the instance var on the class, then just ask the class for its contents and execute them the same way. With this implementation, that means you can't add callbacks for individual objects, though. class Lmao def initialize @str = "HAHAHAHAHAHHAHAHAH" end def self.inherited(base) base.extend Callbacks end def laughing self.class.before_laughing.each do |method| send method end @str end end module Callbacks def before_laughing(*methods) if methods.empty? @before_laughing ||= Array.new else @before_laughing = methods end end end class Lol < Lmao before_laughing :downcase_please def downcase_please @str.downcase! end end a = Lol.new a.laughing # => "hahahahahahhahahah" --0016361e7b0c2c00bf0498a399ab--