Created
September 12, 2013 18:13
-
-
Save jhirn/6541655 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 | |
raise RuntimeError | |
end | |
class Foo | |
def method_missing(name, *args) | |
raise_error | |
end | |
end | |
class RescueBlock | |
def method_missing(name, *args) | |
begin | |
raise_error | |
rescue | |
puts :safe | |
end | |
end | |
end | |
class RescueBlockToo < BasicObject | |
def method_missing(name, *args) | |
begin | |
raise_error | |
rescue | |
puts :not_safe | |
end | |
end | |
end | |
class Inline | |
def method_missing(name, *args) | |
raise_error rescue :safe | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment