Created
November 10, 2010 04:04
-
-
Save viniciussbs/670340 to your computer and use it in GitHub Desktop.
if else for each without extra lines
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
a = [1, 2] | |
if a.each do |i| | |
puts i | |
end.empty? | |
puts "Empty" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment