sharethrough/popularity_contest — pull request #7 by rweald (2013-07-30 23:07:58+00:00)
Title: Refactor for better downstream testability

By moving the real work from the apply method on the Object
to an instance method we make it much easier to test integration
with our library downstream.

With instances of our classes people will be able to use mocks
and dependency injection to ensure they don't hit the real APIs
in test.

Almost perfect backwards API compatibility is maintained by
keeping the apply API around and just delegating to an instance
of the class. The only difference is that the results are now
TwitterResult, FacebookResult, and YouTubeVideoResult which
actually helps to disambiguate between the class that does
work and the results that come back from the API