Created
October 21, 2011 13:09
-
-
Save phoet/1303808 to your computer and use it in GitHub Desktop.
self inspection via exception
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
class Object;def fail!;raise "#{self}";end;end | |
"i want to be raised".fail! | |
# object.rb:1:in `fail!': i want to be raised (RuntimeError) | |
# from object.rb:3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment