OpenSourcePortland/weather_weasel — pull request #1 by marktabler (2013-03-06 17:35:23+00:00)
Title: Add "forecast_days" concept & refactor all_lows to use collect method

This PR breaks the "forecast_days" concept into its own method for ease of use, and demonstrates the "collect" method of an array.

I can't find a good example of #collect off the top of my head, but it does almost exactly what you had written: performs the code in the block on each element in the array, and adds the last evaluated statement to a new array. So,

[1, 2, 3, 4].collect do |number|
number - 1
number + 2
end

Gives us back [3, 4, 5, 6].