Skip to content
This repository has been archived by the owner on Sep 19, 2018. It is now read-only.

Add Tiers, Playlist, ranked seasons parsing, leaderboards, docs links #8

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

z64
Copy link
Contributor

@z64 z64 commented Jul 20, 2017

Todo:

  • Example of navigating Player#ranked_seasons
  • Maybe a client method that resolves #ranked_seasons data into their full cached counterparts (season, playlist, tier)
  • Rubocop
  • Squash

@z64 z64 requested a review from snapcase July 20, 2017 01:28
@z64 z64 changed the title Add Tiers, Playlist, ranked seasons parsing Add Tiers, Playlist, ranked seasons parsing, leaderboards, docs links Jul 20, 2017
@z64 z64 force-pushed the dev/tiers branch 2 times, most recently from b3b2227 to 7162541 Compare July 20, 2017 15:47
# @param playlist_id [Integer]
# @return [Array<Player>]
def ranked_leaderboard(playlist_id)
raise ArgumentError, 'Invalid playlist_id' unless playlists.keys.include?(playlist_id)
Copy link
Contributor Author

@z64 z64 Jul 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW: This does indeed make this the first endpoint that executes another API request (potentially) but I'd rather do this than send a bad request. Let me know if you think otherwise.

Edit:

I'm also not 100% sure ArgumentError is the right thing here, because the whether or not the argument is rejected is based on outside conditions (API) that can't be known by the code itself. It's not really that important, but leaning towards making a custom exception just to clarify this.

@z64 z64 added this to the v1.0.0 milestone Jul 26, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant