PeterBorah / vigor

An unofficial ruby wrapper for the League of Legends API
MIT License
4 stars 4 forks source link

Models for other parts of the API #9

Open PeterBorah opened 10 years ago

PeterBorah commented 10 years ago

We will still iterate on the best design for the stuff we've implemented, but we should try to hit 100% coverage of the API as soon as we can. To do this, we need to come up with intuitive models for the various domain objects.

In particular, statistics are both crucial and modeled (in my opinion) in an ugly way. Suggestions for a useful and intuitive interface welcome!

PeterBorah commented 10 years ago

Alright, so I added Champions, which was simple, and Recent Games, which was not.

Recent Games include players, but Riot's Game API doesn't include the same information as a real Summoner find. It seemed absurd not to use our existing Summoner object, but that gets complicated when Riot is giving us different information in different situations. I did some crazy magic with method_missing so that we can instantiate Summoners with anything, as long as there is an @id, and then it will dynamically hit the API to get any information that is findable but not currently known.

What do you think of this scheme? If it seems good, then it should be pretty easy to add the rest of the API routes.