Created
June 17, 2014 03:08
-
-
Save JonathonMA/f2b2ab11da5a085de9ab 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
class Foo | |
class << self | |
def hello | |
"hello" | |
end | |
end | |
end | |
def singleton &block | |
singleton_class.class_eval &block | |
end | |
class Bar | |
singleton do | |
def hello | |
"NO HELLO" | |
end | |
end | |
end | |
puts Foo.hello | |
puts Bar.hello |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment