Module: NBA::LeagueDashPtTeamDefend

Defined in:
lib/nba/league_dash_pt_team_defend.rb

Overview

Provides methods to retrieve league-wide team defensive tracking statistics

Constant Summary collapse

LEAGUE_DASH_PT_TEAM_DEFEND =

Result set name for league dash PT team defend

Returns:

  • (String)

    the result set name

"LeagueDashPtTeamDefend".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
OVERALL =

Overall defense category constant

Returns:

  • (String)

    the defense category

"Overall".freeze
THREE_POINTERS =

3 Pointers defense category constant

Returns:

  • (String)

    the defense category

"3 Pointers".freeze
TWO_POINTERS =

2 Pointers defense category constant

Returns:

  • (String)

    the defense category

"2 Pointers".freeze
LESS_THAN_6FT =

Less than 6ft defense category constant

Returns:

  • (String)

    the defense category

"Less Than 6Ft".freeze
LESS_THAN_10FT =

Less than 10ft defense category constant

Returns:

  • (String)

    the defense category

"Less Than 10Ft".freeze
GREATER_THAN_15FT =

Greater than 15ft defense category constant

Returns:

  • (String)

    the defense category

"Greater Than 15Ft".freeze

Class Method Summary collapse

Class Method Details

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

Retrieves all league-wide team defensive tracking statistics

Examples:

stats = NBA::LeagueDashPtTeamDefend.all(season: 2024)
stats.first.d_fg_pct #=> 0.421

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

  • defense_category (String) (defaults to: OVERALL)

    the defense category

  • client (Client) (defaults to: CLIENT)

    the API client to use

Returns:

  • (Collection)

    a collection of team defensive statistics



68
69
70
71
72
73
# File 'lib/nba/league_dash_pt_team_defend.rb', line 68

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