This repository has been archived by the owner on Sep 19, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Add Tiers, Playlist, ranked seasons parsing, leaderboards, docs links #8
Open
z64
wants to merge
6
commits into
master
Choose a base branch
from
dev/tiers
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a21d0f3
add Tier, API#tiers, Client#tier
z64 90410be
add Playlist, API#playlists, Client#playlist
z64 dced286
implement Player#ranked_seasons
z64 83da092
add yardopts to set markdown processing on docs
z64 5423182
add API#ranked_leaderboard, API#stat_leaderboard
z64 6319fe6
add links to RLS docs on every endpoint, closes #5
z64 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--markup markdown |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# frozen-string-literal: true | ||
|
||
module RLS | ||
# A Rocket League playlist, and participation statistics | ||
class Playlist | ||
# @return [Integer] | ||
attr_reader :id | ||
|
||
# @return [String] | ||
attr_reader :name | ||
|
||
# @return [Integer] | ||
attr_reader :population | ||
|
||
# @return [Time] | ||
attr_reader :updated_at | ||
|
||
def initialize(data) | ||
@id = data['id'] | ||
@name = data['name'] | ||
@population = data['population']['players'] | ||
@updated_at = Utils.time(data['population']['updatedAt']) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# frozen-string-literal: true | ||
|
||
module RLS | ||
# An entry in a player's ranked history | ||
class RankedHistory | ||
# @return [Integer] | ||
attr_reader :playlist_id | ||
|
||
# @return [Integer] | ||
attr_reader :rank_points | ||
|
||
# @return [Integer, nil] | ||
attr_reader :matches_played | ||
|
||
# @return [Integer, nil] | ||
attr_reader :tier_id | ||
|
||
# @return [Integer, nil] | ||
attr_reader :division | ||
|
||
def initialize(playlist_id, data) | ||
@playlist_id = playlist_id | ||
@rank_points = data['rankPoints'] | ||
@matches_played = data['matchesPlayed'] | ||
@tier_id = data['tier'] | ||
@division = data['division'] | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# frozen-string-literal: true | ||
|
||
module RLS | ||
# A ranked tier in Rocket League | ||
class Tier | ||
# @return [Integer] | ||
attr_reader :id | ||
|
||
# @return [String] | ||
attr_reader :name | ||
|
||
def initialize(data) | ||
@id = data['tierId'] | ||
@name = data['tierName'] | ||
end | ||
end | ||
end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.