Module: NBA::LeagueDashTeamClutch

Defined in:
lib/nba/league_dash_team_clutch.rb

Overview

Provides methods to retrieve league-wide clutch team statistics

Constant Summary collapse

LEAGUE_DASH_TEAM_CLUTCH =

Result set name for league dash team clutch

Returns:

  • (String)

    the result set name

"LeagueDashTeamClutch".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_100 =

Per mode constant for per 100 possessions

Returns:

  • (String)

    the per mode

"Per100Possessions".freeze
LAST_5_MINUTES =

Clutch time constant for last 5 minutes

Returns:

  • (String)

    the clutch time

"Last 5 Minutes".freeze
LAST_4_MINUTES =

Clutch time constant for last 4 minutes

Returns:

  • (String)

    the clutch time

"Last 4 Minutes".freeze
LAST_3_MINUTES =

Clutch time constant for last 3 minutes

Returns:

  • (String)

    the clutch time

"Last 3 Minutes".freeze
LAST_2_MINUTES =

Clutch time constant for last 2 minutes

Returns:

  • (String)

    the clutch time

"Last 2 Minutes".freeze
LAST_1_MINUTE =

Clutch time constant for last 1 minute

Returns:

  • (String)

    the clutch time

"Last 1 Minute".freeze
AHEAD_OR_BEHIND =

Ahead/behind constant for ahead or behind

Returns:

  • (String)

    the ahead/behind value

"Ahead or Behind".freeze
BEHIND_OR_TIED =

Ahead/behind constant for behind or tied

Returns:

  • (String)

    the ahead/behind value

"Behind or Tied".freeze
AHEAD_OR_TIED =

Ahead/behind constant for ahead or tied

Returns:

  • (String)

    the ahead/behind value

"Ahead or Tied".freeze

Class Method Summary collapse

Class Method Details

.all(season: Utils.current_season, season_type: REGULAR_SEASON, clutch_time: LAST_5_MINUTES, ahead_behind: AHEAD_OR_BEHIND, point_diff: 5, per_mode: PER_GAME, client: CLIENT) ⇒ Collection

Retrieves league-wide clutch team statistics

Examples:

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

Parameters:

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

    the season year

  • season_type (String) (defaults to: REGULAR_SEASON)

    the season type

  • clutch_time (String) (defaults to: LAST_5_MINUTES)

    the clutch time definition

  • ahead_behind (String) (defaults to: AHEAD_OR_BEHIND)

    the ahead/behind filter

  • point_diff (Integer) (defaults to: 5)

    the point differential

  • per_mode (String) (defaults to: PER_GAME)

    the per mode

  • client (Client) (defaults to: CLIENT)

    the API client to use

Returns:

  • (Collection)

    a collection of clutch team stats



80
81
82
83
84
85
86
87
# File 'lib/nba/league_dash_team_clutch.rb', line 80

def self.all(season: Utils.current_season, season_type: REGULAR_SEASON, clutch_time: LAST_5_MINUTES,
  ahead_behind: AHEAD_OR_BEHIND, point_diff: 5, per_mode: PER_GAME, client: CLIENT)
  opts = {season_type: season_type, clutch_time: clutch_time, ahead_behind: ahead_behind,
          point_diff: point_diff, per_mode: per_mode}
  path = build_path(season, opts)
  response = client.get(path)
  parse_response(response, season)
end