Created
March 12, 2015 17:39
-
-
Save vadviktor/5cf83b3ba5447e2fc58a to your computer and use it in GitHub Desktop.
Plain example using Ruby Kernel::catch http://ruby-doc.org/core-2.2.1/Kernel.html#method-i-catch
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
| s = nil | |
| f = nil | |
| s = catch :skipped do | |
| f = catch :failed do | |
| throw :skipped, 'i skipped' | |
| # throw :failed, 'i failed' | |
| end | |
| 'deal with failed code' unless f.nil? | |
| end | |
| 'deal with skipped code' unless s.nil? | |
| puts s.inspect | |
| puts f.inspect |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment