Created
April 26, 2016 11:14
-
-
Save keithrbennett/6876886030c7d6cf80d1b6fbcfebf7ae to your computer and use it in GitHub Desktop.
Part of comment to http://stackoverflow.com/questions/36860798/rewrite-multiple-inline-return
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 even_or_odd_as_string(num) | |
if num.even? | |
'even' | |
else | |
'odd' | |
end | |
end | |
2.3.0 :009 > even_or_odd_as_string 3 | |
=> "odd" | |
2.3.0 :010 > even_or_odd_as_string 4 | |
=> "even" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment