Created
January 24, 2016 09:18
-
-
Save taisyo7333/8e264b78cfe78371e74a to your computer and use it in GitHub Desktop.
Ruby Exception
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
# encoding: SJIS | |
begin # run | |
p 1 | |
rescue # Do not run , because of no-execption occurs. | |
p 0 | |
else # run , because of no-execption occurs. | |
p 2 | |
ensure # run always at last. | |
p 3 | |
end |
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
>ruby Code3-158.rb | |
ruby Code3-158.rb | |
1 | |
2 | |
3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment