agoragames/bnet_scraper — pull request #10 by cadwallion (2013-02-22 07:22:28+00:00)
Title: Improved Profile API

Instead of the previous Hash-based scraper outputs, this adds the concept of models and a root object, with scrapers filling in the gaps.

To scrape a profile, you still start with an instance of `ProfileScraper`. Calling `ProfileScraper#scrape` returns a `BnetScraper::Starcraft2::Profile` object now instead of a Hash. In addition to methods instead of hash keys, an additional piece of functionality is the `achievements`, `match_history`, and `leagues` methods. Each of these methods returns an array, however on the first call to these methods it will setup the appropriate scraper object, scrape, and fill in the gaps.

Drilling down even further, for every `League` object there contains information that can be accessed without scraping beyond the `Profile`. If you attempt to access additional information, the `League` object will instantiate a `BnetScraper::Starcraft2::LeagueScraper` object, grab league information, and map that onto itself.

This fixes #9 although full_scrape still exists, it just eager-loads these scrapers.