Created
February 15, 2011 22:56
-
-
Save texel/828457 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
| class SuperClass | |
| def foo | |
| puts "I'm in super!" | |
| end | |
| alias :bar foo | |
| end | |
| class SubClass < SuperClass | |
| def foo | |
| puts "I'm in sub!" | |
| end | |
| end | |
| sup = SuperClass.new | |
| sup.foo | |
| sup.bar | |
| sub = SubClass.new | |
| sub.foo | |
| sub.bar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment