Module: NBA::Leaders
- Defined in:
- lib/nba/leaders.rb
Overview
Provides methods to retrieve NBA statistical leaders
Constant Summary collapse
- PTS =
Points per game category
"PTS".freeze
- REB =
Rebounds per game category
"REB".freeze
- AST =
Assists per game category
"AST".freeze
- STL =
Steals per game category
"STL".freeze
- BLK =
Blocks per game category
"BLK".freeze
- FG_PCT =
Field goal percentage category
"FG_PCT".freeze
- FG3_PCT =
Three point percentage category
"FG3_PCT".freeze
- FT_PCT =
Free throw percentage category
"FT_PCT".freeze
- EFF =
Efficiency category
"EFF".freeze
Class Method Summary collapse
-
.find(category:, season: Utils.current_season, season_type: "Regular Season", limit: 10, client: CLIENT) ⇒ Collection
Retrieves league leaders for a statistical category.
Class Method Details
.find(category:, season: Utils.current_season, season_type: "Regular Season", limit: 10, client: CLIENT) ⇒ Collection
Retrieves league leaders for a statistical category
55 56 57 58 59 60 |
# File 'lib/nba/leaders.rb', line 55 def self.find(category:, season: Utils.current_season, season_type: "Regular Season", limit: 10, client: CLIENT) per_mode = PERCENTAGE_CATEGORIES.include?(category) ? "Totals" : "PerGame" path = "leagueleaders?LeagueID=00&PerMode=#{per_mode}&Scope=S&Season=#{Utils.format_season(season)}" \ "&SeasonType=#{season_type}&StatCategory=#{category}" parse_leaders_response(client.get(path), category, limit) end |