Last active
March 15, 2016 14:38
-
-
Save rotelstift/71f36d14aaee08dc8363 to your computer and use it in GitHub Desktop.
This file contains 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
obj1 = Object.new | |
def obj1.singleton_method_added(n) | |
p n | |
end | |
def obj1.new_singleton_method | |
end | |
# => :singleton_method_added | |
# => :new_singleton_method | |
class Object | |
def singleton_method_added(n) | |
p n | |
end | |
end | |
obj2 = Object.new | |
def obj2.new_singleton_method | |
end | |
# => :new_singleton_method | |
str = String.new | |
def str.singleton_method_added(n) | |
p n | |
end | |
def str.new_singleton_method | |
end | |
# => :singleton_method_added | |
# => :new_singleton_method |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment