Skip to content

Instantly share code, notes, and snippets.

@jah2488
Created April 7, 2015 17:08
Show Gist options
  • Select an option

  • Save jah2488/e1eae202c0724a9f85b4 to your computer and use it in GitHub Desktop.

Select an option

Save jah2488/e1eae202c0724a9f85b4 to your computer and use it in GitHub Desktop.
If you find yourself wanting to write this code, you are probably missing an abstraction, but I like that this is possible either way.
articles.each do |article|
puts article
end.empty? and begin
puts ‘sorry, no articles’
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment