Module: NBA::LeagueDashPtStats

Defined in:
lib/nba/league_dash_pt_stats.rb

Overview

Provides methods to retrieve league-wide player and team tracking statistics

Constant Summary collapse

LEAGUE_DASH_PT_STATS =

Result set name for league dash PT stats

Returns:

  • (String)

    the result set name

"LeagueDashPtStats".freeze
REGULAR_SEASON =

Regular season type constant

Returns:

  • (String)

    the season type

"Regular Season".freeze
PLAYOFFS =

Playoffs season type constant

Returns:

  • (String)

    the season type

"Playoffs".freeze
PER_GAME =

Per game mode constant

Returns:

  • (String)

    the per mode

"PerGame".freeze
TOTALS =

Totals mode constant

Returns:

  • (String)

    the per mode

"Totals".freeze
PLAYER =

Player mode constant

Returns:

  • (String)

    the player or team mode

"Player".freeze
TEAM =

Team mode constant

Returns:

  • (String)

    the player or team mode

"Team".freeze
SPEED_DISTANCE =

Speed and distance measure type constant

Returns:

  • (String)

    the PT measure type

"SpeedDistance".freeze

Class Method Summary collapse

Class Method Details

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

Retrieves all league-wide player or team tracking statistics

Examples:

stats = NBA::LeagueDashPtStats.all(season: 2024)
stats.first.avg_speed #=> 4.25

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

  • player_or_team (String) (defaults to: PLAYER)

    whether to get player or team stats

  • pt_measure_type (String) (defaults to: SPEED_DISTANCE)

    the PT measure type

  • client (Client) (defaults to: CLIENT)

    the API client to use

Returns:

  • (Collection)

    a collection of tracking statistics



57
58
59
60
61
62
63
# File 'lib/nba/league_dash_pt_stats.rb', line 57

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