RLovelett/sports_data_api — pull request #20 by RLovelett (2013-11-14 03:27:02+00:00)
Title: Adding support for team_roster api

This pull request supersedes #19 and fixes #12.

@rottmanj thank you for the original pull request. Unfortunately, it did not merge cleanly because it appears it was not based off of master and also duplicated some functionality (see #11).

Basically, what I decided to do was drop your `Nfl#get_teams` implementation and use the already present `Nfl#teams` method. I then provided an alias from `Nfl#get_teams` to `Nfl#teams`. That way any code you were using that relied on the existence of that method will not break. The `Nfl#teams` method returns a `SportsDataApi::Nfl::Teams` object. This object includes `Enumerable` so it should behave similar to an `Array` (which is what your implementation returned). It also provides some meta-methods to allow you to quickly retrieve teams by division and conference (see https://github.com/RLovelett/sports_data_api/blob/master/spec/lib/sports_data_api/nfl/teams_spec.rb for some example usages). Hopefully, this will provide both of our needs.

The `Nfl#team_rosters` method is a welcome addition so I am going to pull that into the code base. I whittled the commits down to the smallest changes I could without degrading the feature you were trying to add. I tried to remove the changes to the cassettes and such.