Module: NBA::LeagueDashPlayerStats

Defined in:
lib/nba/league_dash_player_stats.rb

Overview

Provides methods to retrieve league-wide player statistics

Constant Summary collapse

LEAGUE_DASH_PLAYER_STATS =

Result set name for league dash player stats

Returns:

  • (String)

    the result set name

"LeagueDashPlayerStats".freeze
REGULAR_SEASON =

Season type constant for regular season

Returns:

  • (String)

    the season type

"Regular Season".freeze
PLAYOFFS =

Season type constant for playoffs

Returns:

  • (String)

    the season type

"Playoffs".freeze
PER_GAME =

Per mode constant for per game stats

Returns:

  • (String)

    the per mode

"PerGame".freeze
TOTALS =

Per mode constant for totals

Returns:

  • (String)

    the per mode

"Totals".freeze
PER_36 =

Per mode constant for per 36 minutes

Returns:

  • (String)

    the per mode

"Per36".freeze

Class Method Summary collapse

Class Method Details

.all(season: Utils.current_season, season_type: REGULAR_SEASON, per_mode: PER_GAME, client: CLIENT) ⇒ Collection

Retrieves league-wide player statistics

Examples:

stats = NBA::LeagueDashPlayerStats.all(season: 2024)
stats.each { |s| puts "#{s.player_name}: #{s.pts} ppg" }

Parameters:

  • season (Integer) (defaults to: Utils.current_season)

    the season year

  • season_type (String) (defaults to: REGULAR_SEASON)

    the season type

  • per_mode (String) (defaults to: PER_GAME)

    the per mode

  • client (Client) (defaults to: CLIENT)

    the API client to use

Returns:



46
47
48
49
50
# File 'lib/nba/league_dash_player_stats.rb', line 46

def self.all(season: Utils.current_season, season_type: REGULAR_SEASON, per_mode: PER_GAME, client: CLIENT)
  path = build_path(season, season_type, per_mode)
  response = client.get(path)
  parse_response(response, season)
end