Created
May 6, 2010 01:39
-
-
Save notahat/391685 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 A | |
| def hello | |
| "A#hello" | |
| end | |
| def method_missing(method, *args) | |
| "A#method_missing" | |
| end | |
| protected :hello | |
| end | |
| p A.new.hello # => "A#method_missing" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
And also
Right, so you can hide functionality in a subclass that is provided by the superclass.
That sounds like a bad idea, since it sort of stops you being able to rely on object-oriented polymorphism.