Created
May 31, 2013 12:11
-
-
Save marcroberts/5684576 to your computer and use it in GitHub Desktop.
object.new now calls initialise if it exists before trying initialize
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 Object | |
| alias :old_initialize :initialize | |
| def initialize(*args,&blk) | |
| if respond_to? :initialise | |
| initialise(*args,&blk) | |
| else | |
| old_initialize(*args,&blk) | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment