Created
April 6, 2020 12:53
-
-
Save rpdecks/67f82a7624be25a3f9f29631c36f2488 to your computer and use it in GitHub Desktop.
Customer meal waiter lab
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
#why does this work? explain syntax and logic | |
def best_tipper | |
best_tipped_meal = meals.max do |meal_a, meal_b| | |
meal_a.tip <=> meal_b.tip | |
end | |
best_tipped_meal.customer | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment