Created
December 2, 2013 15:55
-
-
Save dinks/7751631 to your computer and use it in GitHub Desktop.
Define Singleton Method
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
| # From https://github.com/marcandre/backports | |
| unless Kernel.method_defined? :define_singleton_method | |
| module Kernel | |
| def define_singleton_method(*args, &block) | |
| class << self | |
| self | |
| end.send(:define_method, *args, &block) | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment