Created
December 25, 2010 11:03
-
-
Save ignacy/754824 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 A | |
class << self | |
def foo | |
puts "foo" | |
end | |
end | |
end | |
A.foo | |
class A | |
class << self | |
alias original_foo foo | |
def foo | |
puts "I say bar but only once.." | |
alias foo original_foo | |
end | |
end | |
end | |
A.foo | |
A.foo | |
# => foo | |
# => I say bar but only once.. | |
# => foo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment