Created
September 3, 2016 09:01
-
-
Save jage/f10e6e9d73397548de92252f31228879 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
$ ruby test.rb | |
4 | |
3 | |
2 | |
1 | |
0 |
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
RETRY_COUNT = 5 | |
def test | |
raise "banana" | |
rescue | |
retry_count ||= RETRY_COUNT | |
retry_count -= 1 | |
puts retry_count | |
retry if retry_count > 0 | |
end | |
test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment