Module: NBA::LeagueDashTeamStats

Defined in:
lib/nba/league_dash_team_stats.rb

Overview

Provides methods to retrieve league-wide team statistics

Constant Summary collapse

LEAGUE_DASH_TEAM_STATS =

Result set name

Returns:

  • (String)

    the result set name

"LeagueDashTeamStats".freeze
REGULAR_SEASON =

Regular season type

Returns:

  • (String)

    the season type

"Regular Season".freeze
PLAYOFFS =

Playoffs season type

Returns:

  • (String)

    the season type

"Playoffs".freeze
PER_GAME =

Per game mode

Returns:

  • (String)

    the per mode

"PerGame".freeze
TOTALS =

Totals mode

Returns:

  • (String)

    the per mode

"Totals".freeze
PER_100 =

Per 100 possessions mode

Returns:

  • (String)

    the per mode

"Per100Possessions".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 team statistics

Examples:

stats = NBA::LeagueDashTeamStats.all(season: 2024)
stats.each { |s| puts "#{s.team_name}: #{s.pts} PPG" }

Parameters:

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

    the season year (defaults to current season)

  • season_type (String) (defaults to: REGULAR_SEASON)

    the season type (Regular Season, Playoffs)

  • per_mode (String) (defaults to: PER_GAME)

    the per mode (PerGame, Totals, Per100Possessions)

  • client (Client) (defaults to: CLIENT)

    the API client to use

Returns:



45
46
47
48
49
# File 'lib/nba/league_dash_team_stats.rb', line 45

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