Module: NBA::LeagueDashPlayerShotLocations

Defined in:
lib/nba/league_dash_player_shot_locations.rb

Overview

Provides methods to retrieve league-wide player shot location statistics

Constant Summary collapse

SHOT_LOCATIONS =

Result set name for shot locations

Returns:

  • (String)

    the result set name

"ShotLocations".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
BY_ZONE =

By 5-foot zone distance range

Returns:

  • (String)

    the distance range

"By Zone".freeze

Class Method Summary collapse

Class Method Details

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

Retrieves all league-wide player shot location statistics

Examples:

stats = NBA::LeagueDashPlayerShotLocations.all(season: 2024)
stats.first.restricted_area_fg_pct #=> 0.595

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

  • distance_range (String) (defaults to: BY_ZONE)

    the distance range

  • client (Client) (defaults to: CLIENT)

    the API client to use

Returns:

  • (Collection)

    a collection of player shot location statistics



48
49
50
51
52
53
# File 'lib/nba/league_dash_player_shot_locations.rb', line 48

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