Skip to content

Instantly share code, notes, and snippets.

@kennym
Created July 31, 2013 21:13
Show Gist options
  • Save kennym/6126239 to your computer and use it in GitHub Desktop.
Save kennym/6126239 to your computer and use it in GitHub Desktop.
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