Module: NBA::PlayerDashPtShotDefend

Defined in:
lib/nba/player_dash_pt_shot_defend.rb

Overview

Provides methods to retrieve player tracking defensive shot statistics

Constant Summary collapse

DEFENDING_SHOTS =

Result set name for defending shots

Returns:

  • (String)

    the result set name

"DefendingShots".freeze

Class Method Summary collapse

Class Method Details

.find(player:, team: 0, season: Utils.current_season, season_type: "Regular Season", per_mode: "PerGame", client: CLIENT) ⇒ Collection

Retrieves defensive shot statistics for a player

Examples:

stats = NBA::PlayerDashPtShotDefend.find(player: 201939)
stats.each { |s| puts "#{s.defense_category}: #{s.d_fg_pct}" }

Parameters:

  • player (Integer, Player)

    the player ID or Player object

  • team (Integer, Team) (defaults to: 0)

    the team ID or Team object

  • 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: "PerGame")

    the per mode

  • client (Client) (defaults to: CLIENT)

    the API client to use

Returns:

  • (Collection)

    a collection of defensive shot statistics



29
30
31
32
33
34
# File 'lib/nba/player_dash_pt_shot_defend.rb', line 29

def self.find(player:, team: 0, season: Utils.current_season, season_type: "Regular Season",
  per_mode: "PerGame", client: CLIENT)
  path = build_path(player, team, season, season_type, per_mode)
  response = client.get(path)
  parse_response(response)
end