Skip to content

Instantly share code, notes, and snippets.

@heftig
Forked from dmonopoly/gist:1164395
Created August 23, 2011 05:24
Show Gist options
  • Save heftig/1164406 to your computer and use it in GitHub Desktop.
Save heftig/1164406 to your computer and use it in GitHub Desktop.
nil and false notion...
def mealtimes(meal)
arr = []
arr << "breakfast" if meal.breakfast
arr << "lunch" if meal.lunch
arr << "dinner" if meal.dinner
arr.join(", ").sub(/(.*),/, "\\1 and")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment