Created
September 12, 2012 19:55
-
-
Save efatsi/3709460 to your computer and use it in GitHub Desktop.
methodology comparison
This file contains hidden or 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
def find_suggestions_for(restaurant) | |
past_orders = [] | |
orders.each {|o| past_orders << o if o.restaurant == restaurant } | |
past_orders | |
end | |
def find_suggestions_for(restaurant) | |
orders.inject([]) do |result, order| | |
result << order if order.restaurant == restaurant | |
result | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment