Created
February 5, 2015 06:11
-
-
Save 2get/be0910e768bb6abcd6eb to your computer and use it in GitHub Desktop.
case 式の返り値に対しての処理
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
def case1 | |
i = 1 | |
case i | |
when 1 | |
5 | |
end + 10 | |
end | |
def case2 | |
i = 1 | |
case i | |
when 1 | |
'1' | |
end + "www" | |
end | |
puts case1 # => 15 | |
puts case2 # => 1www |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment