Skip to content

Instantly share code, notes, and snippets.

@bobbysmith
Created April 23, 2014 20:52
Show Gist options
  • Select an option

  • Save bobbysmith/11231994 to your computer and use it in GitHub Desktop.

Select an option

Save bobbysmith/11231994 to your computer and use it in GitHub Desktop.
all toppings vegetarian
def vegetarian?
# loops through @toppings, and checks if each topping is vegetarian
# if all toppings are vegetarian, return true
# @toppings.each do |topping|
# if topping.vegetarian != true
# return false
# end
# end
# true
@toppings.all? do |topping|
topping.vegetarian == true
end
# veg
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment