Created
December 12, 2013 17:17
-
-
Save badosu/7931661 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
def return_nil(condition) | |
return 1 if condition | |
end | |
def return_false(condition) | |
return 1 if condition | |
return false | |
end | |
puts "return_nil(true)" | |
puts return_nil(true).inspect | |
puts "return_nil(false)" | |
puts return_nil(false).inspect | |
puts "return_false(true)" | |
puts return_false(true).inspect | |
puts "return_false(false)" | |
puts return_false(false).inspect | |
# ~ ❯❯❯ ruby asd.rb ⏎ | |
# return_nil(true) | |
# 1 | |
# return_nil(false) | |
# nil | |
# return_false(true) | |
# 1 | |
# return_false(false) | |
# false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment