Created
May 23, 2010 15:43
-
-
Save nudded/411030 to your computer and use it in GitHub Desktop.
This file contains 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
def raise_error(error_name, superclass = Exception) | |
raise self.class.const_get error_name | |
rescue NameError | |
self.class.const_set error_name, Class.new(superclass) | |
retry | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment