Module: NBA::PlayerDashPtShots

Defined in:
lib/nba/player_dash_pt_shots.rb

Overview

Provides methods to retrieve player tracking shot statistics

Constant Summary collapse

OVERALL =

Result set name for overall shooting

Returns:

  • (String)

    the result set name

"Overall".freeze
GENERAL =

Result set name for general shooting

Returns:

  • (String)

    the result set name

"GeneralShooting".freeze
DRIBBLE =

Result set name for dribble shooting

Returns:

  • (String)

    the result set name

"DribbleShooting".freeze
TOUCH_TIME =

Result set name for touch time shooting

Returns:

  • (String)

    the result set name

"TouchTimeShooting".freeze
SHOT_CLOCK =

Result set name for shot clock shooting

Returns:

  • (String)

    the result set name

"ShotClockShooting".freeze
CLOSEST_DEFENDER =

Result set name for closest defender shooting

Returns:

  • (String)

    the result set name

"ClosestDefenderShooting".freeze
CLOSEST_DEFENDER_10FT =

Result set name for closest defender 10ft+ shooting

Returns:

  • (String)

    the result set name

"ClosestDefender10ftPlusShooting".freeze

Class Method Summary collapse

Class Method Details

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

Retrieves closest defender shot statistics for a player

Examples:

stats = NBA::PlayerDashPtShots.closest_defender(player: 201939)
stats.each { |s| puts "#{s.shot_type}: #{s.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 shot statistics



148
149
150
151
152
# File 'lib/nba/player_dash_pt_shots.rb', line 148

def self.closest_defender(player:, team: 0, season: Utils.current_season, season_type: "Regular Season",
  per_mode: "PerGame", client: CLIENT)
  options = {season_type: season_type, per_mode: per_mode, result_set: CLOSEST_DEFENDER}
  fetch_stats(player, team, season, options, client: client)
end

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

Retrieves closest defender 10ft+ shot statistics for a player

Examples:

stats = NBA::PlayerDashPtShots.closest_defender_10ft(player: 201939)
stats.each { |s| puts "#{s.shot_type}: #{s.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 shot statistics



167
168
169
170
171
# File 'lib/nba/player_dash_pt_shots.rb', line 167

def self.closest_defender_10ft(player:, team: 0, season: Utils.current_season, season_type: "Regular Season",
  per_mode: "PerGame", client: CLIENT)
  options = {season_type: season_type, per_mode: per_mode, result_set: CLOSEST_DEFENDER_10FT}
  fetch_stats(player, team, season, options, client: client)
end

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

Retrieves dribble shot statistics for a player

Examples:

stats = NBA::PlayerDashPtShots.dribble(player: 201939)
stats.each { |s| puts "#{s.shot_type}: #{s.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 shot statistics



91
92
93
94
95
# File 'lib/nba/player_dash_pt_shots.rb', line 91

def self.dribble(player:, team: 0, season: Utils.current_season, season_type: "Regular Season",
  per_mode: "PerGame", client: CLIENT)
  options = {season_type: season_type, per_mode: per_mode, result_set: DRIBBLE}
  fetch_stats(player, team, season, options, client: client)
end

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

Retrieves general shot statistics for a player

Examples:

stats = NBA::PlayerDashPtShots.general(player: 201939)
stats.each { |s| puts "#{s.shot_type}: #{s.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 shot statistics



72
73
74
75
76
# File 'lib/nba/player_dash_pt_shots.rb', line 72

def self.general(player:, team: 0, season: Utils.current_season, season_type: "Regular Season",
  per_mode: "PerGame", client: CLIENT)
  options = {season_type: season_type, per_mode: per_mode, result_set: GENERAL}
  fetch_stats(player, team, season, options, client: client)
end

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

Retrieves overall shot statistics for a player

Examples:

stats = NBA::PlayerDashPtShots.overall(player: 201939)
stats.first.fg_pct #=> 0.472

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 shot statistics



53
54
55
56
57
# File 'lib/nba/player_dash_pt_shots.rb', line 53

def self.overall(player:, team: 0, season: Utils.current_season, season_type: "Regular Season",
  per_mode: "PerGame", client: CLIENT)
  options = {season_type: season_type, per_mode: per_mode, result_set: OVERALL}
  fetch_stats(player, team, season, options, client: client)
end

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

Retrieves shot clock shot statistics for a player

Examples:

stats = NBA::PlayerDashPtShots.shot_clock(player: 201939)
stats.each { |s| puts "#{s.shot_type}: #{s.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 shot statistics



129
130
131
132
133
# File 'lib/nba/player_dash_pt_shots.rb', line 129

def self.shot_clock(player:, team: 0, season: Utils.current_season, season_type: "Regular Season",
  per_mode: "PerGame", client: CLIENT)
  options = {season_type: season_type, per_mode: per_mode, result_set: SHOT_CLOCK}
  fetch_stats(player, team, season, options, client: client)
end

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

Retrieves touch time shot statistics for a player

Examples:

stats = NBA::PlayerDashPtShots.touch_time(player: 201939)
stats.each { |s| puts "#{s.shot_type}: #{s.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 shot statistics



110
111
112
113
114
# File 'lib/nba/player_dash_pt_shots.rb', line 110

def self.touch_time(player:, team: 0, season: Utils.current_season, season_type: "Regular Season",
  per_mode: "PerGame", client: CLIENT)
  options = {season_type: season_type, per_mode: per_mode, result_set: TOUCH_TIME}
  fetch_stats(player, team, season, options, client: client)
end