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

Commit

Permalink
add links to RLS docs on every endpoint, closes #5
Browse files Browse the repository at this point in the history
  • Loading branch information
z64 committed Jul 20, 2017
1 parent 5423182 commit 6319fe6
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions lib/rls/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ module API
# The base URL of the RocketLeagueStats API
APIBASE = 'https://api.rocketleaguestats.com/v1/'

# Retrieve a single player
# Retrieve a single player.
# [API docs for this method](http://documentation.rocketleaguestats.com/#single-player)
# @param id [String, Integer] The unique identifier:
# Steam 64 ID / PSN Username / Xbox GamerTag or XUID
# @param platform [Platform, Integer] The platform to use
Expand All @@ -36,7 +37,8 @@ def player(id, platform = Platform::Steam)
Player.new(response)
end

# Retrieves a batch of up to 10 players at a time from different platforms
# Retrieves a batch of up to 10 players at a time from different platforms.
# [API docs for this method](http://documentation.rocketleaguestats.com/#batch-players)
# @example Retrieve a batch of players from different platforms
# client.players(
# 76561198033338223, 1,
Expand Down Expand Up @@ -64,6 +66,7 @@ def players(*request_data)

# Searches RLS's database for players matching a given display name.
# The response is paginated.
# [API docs for this method](http://documentation.rocketleaguestats.com/#search-players)
# @example Retrieve the results, one page at a time
# results = client.search('player')
# results.players #=> first page
Expand All @@ -90,7 +93,8 @@ def search(display_name, page = 0)
SearchResults.new(self, response, display_name)
end

# Retrieve the different platforms unless they've already been cached
# Retrieve the different platforms unless they've already been cached.
# [API docs for this method](http://documentation.rocketleaguestats.com/#platforms)
# @param renew [true, false] Ignore the cache and make a new request
# @return [Array<Platform>] An array of platform objects
def platforms(renew = false)
Expand All @@ -107,7 +111,8 @@ def platforms(renew = false)
end
end

# Retrieve season information
# Retrieve season information.
# [API docs for this method](http://documentation.rocketleaguestats.com/#seasons)
# @param renew [true, false] Ignore the cache and make a new request
# @return [Hash<Integer => Season] The seasons by ID
def seasons(renew = false)
Expand All @@ -124,7 +129,8 @@ def seasons(renew = false)
end
end

# Retrieve the current season's tiers
# Retrieve the current season's tiers.
# [API docs for this method](http://documentation.rocketleaguestats.com/#tiers)
# @param renew [true, false] Ignore the cache and make a new request
# @return [Hash<Integer => Tier] The tiers by ID
def tiers(renew = false)
Expand All @@ -141,7 +147,8 @@ def tiers(renew = false)
end
end

# Retrieve the current playlists
# Retrieve the current playlists.
# [API docs for this method](http://documentation.rocketleaguestats.com/#playlists)
# @param renew [true, false] Ignore the cache and make a new request
# @return [Hash<Integer => Playlist] The playlist by ID
def playlists(renew = false)
Expand All @@ -158,7 +165,8 @@ def playlists(renew = false)
end
end

# Returns the top 100 players for the current season on a particular playlist
# Returns the top 100 players for the current season on a particular playlist.
# [API docs for this method](http://documentation.rocketleaguestats.com/#ranked-leaderboard)
# @param playlist_id [Integer]
# @return [Array<Player>]
def ranked_leaderboard(playlist_id)
Expand All @@ -177,7 +185,8 @@ def ranked_leaderboard(playlist_id)
# Valid stat types for the leaderboard/stat endpoint
VALID_STAT_TYPE = %i[wins goals mvps saves shots assists].freeze

# Returns the top 100 players for the current season by a particular stat
# Returns the top 100 players for the current season by a particular stat.
# [API docs for this method](http://documentation.rocketleaguestats.com/#stat-leaderboard)
# @param type [Symbol, String]
# @return [Array<Player>]
# @raise [ArgumentError] if an unsupported type is specified
Expand Down

0 comments on commit 6319fe6

Please sign in to comment.