OpenSourcePortland/weather_weasel — pull request #5 by marktabler (2013-03-11 07:13:35+00:00)
Title: Simplify method for pops

Made a change reflecting DRY principle: we were repeating ourselves in terms of POP data.

Note that in the new code, I simply changed one letter and the notation we use to retrieve the data. Everything reads just as clearly, and I can therefore remove an entire method from the Forecast object.

The key point, though, is that now if the location of the pops data changes in the API, I only need to make that change in one method: Forecast#pops. Everything else benefits from that update naturally. That's the DRY principle in action: Don't Repeat Yourself.

There are some other methods in the code like this - see if you can remove them from Forecast to clean things up a bit.