Skip to content

Instantly share code, notes, and snippets.

@viniciussbs
Created November 10, 2010 04:04
Show Gist options
  • Save viniciussbs/670340 to your computer and use it in GitHub Desktop.
Save viniciussbs/670340 to your computer and use it in GitHub Desktop.
if else for each without extra lines
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