Last active
August 29, 2015 14:15
-
-
Save aruprakshit/374ef9074f39dd793ad4 to your computer and use it in GitHub Desktop.
Creating a method which has the same name as its class name..like Integer(), Array() etc.
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
| module Kernel | |
| module_function | |
| def CustomClass() | |
| CustomKlass.new | |
| end | |
| end | |
| class CustomKlass | |
| end | |
| CustomClass() # => #<CustomKlass:0x9c0165c> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment