title: How to intercept class method calls, not just instance method calls
body: <p>Can someone help me modify the answer provided for <a href="https://stackoverflow.com/questions/7137238/how-can-i-intercept-method-call-in-ruby">intercepting instance method calls</a> so that it works with either class method calls, or both class and instance method calls? From my limited knowledge of metaprogramming with Ruby, I'd imagine it would have something to do with opening up the singleton class some place using <code>class &lt;&lt; self</code>, but I've tried doing that in various places with this code and I can't seem to figure it out. Instead of a direct answer, though, could you provide me with a push in the right direction? I'm a big fan of figuring things out for myself unless I'm completely out of my depth. Thanks!</p>