petems / riot_api

A Ruby wrapper for the Riot API for League of Legends - https://developer.riotgames.com/api/
MIT License
12 stars 3 forks source link

Added passing of options to stats ranked and summary. #22

Closed pcg79 closed 10 years ago

pcg79 commented 10 years ago

I'm not super crazy with this implementation but it's the easiest possible way. Just allow the user to pass in the season via:

ra.stats.ranked id, season: "SEASON3"

I would much rather do something like just pass in the season number as an optional param:

ra.stats.ranked id, 3

but I'm not sure I like that either. I'm open to suggestions or just feel free to refactor.

One thing bad is if the user doesn't specify the season name exactly right (SEASON3, SEASON4), Faraday throws a JSON parse error. So it definitely needs some love. I'm just not sure what kind of love.

coveralls commented 10 years ago

Coverage Status

Coverage remained the same when pulling e9205015db0558e5af854d5f8d59641968f2742e on pcg79:allow_stats_to_specify_season into 6dc36007aec23eb22e856fa577e7c0def9d8810c on petems:master.

petems commented 10 years ago

Signed off :+1: