Created
October 8, 2014 16:49
-
-
Save TheEmpty/0710ac12b56cb1881e85 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 isVisable | |
| true | |
| end | |
| def method_missing(m, *args, &block) | |
| if m =~ /eh$/i | |
| merica = "is" + m.to_s.capitalize.split(/eh$/i).first | |
| if self.respond_to?(merica) | |
| return self.send(merica) | |
| end | |
| end | |
| super | |
| end | |
| end | |
| a = A.new | |
| puts a.isVisable | |
| puts a.visableEh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment