Created
December 10, 2012 23:07
-
-
Save kyrylo/4254201 to your computer and use it in GitHub Desktop.
Empty or not empty
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
if [].each do |elem| | |
puts "NOT EMPTY!" | |
end.empty? | |
puts "EMPTY!" | |
end | |
#EMPTY! | |
#=> nil | |
if [:piglet].each do |elem| | |
puts "NOT EMPTY!" | |
end.empty? | |
puts "EMPTY!" | |
end | |
# NOT EMPTY! | |
#=> nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment