Created
July 31, 2013 21:13
-
-
Save kennym/6126239 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Magic | |
def self.included(base) | |
base.extend ClassMethods | |
end | |
module ClassMethods | |
def method_added(name) | |
puts "instance method '#{name}' added" | |
end | |
def singleton_method_added(name) | |
puts "class method '#{name}' added" | |
end | |
end | |
end | |
class Foo | |
include Magic | |
def bla | |
end | |
def blubb | |
end | |
def self.foobar | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment