Module: NBA::TeamDashPtShots

Defined in:
lib/nba/team_dash_pt_shots.rb

Overview

Provides methods to retrieve team tracking shot statistics

API:

  • public

Constant Summary collapse

GENERAL =

Result set name for general shooting

Returns:

  • the result set name

API:

  • public

"GeneralShooting".freeze
SHOT_CLOCK =

Result set name for shot clock shooting

Returns:

  • the result set name

API:

  • public

"ShotClockShooting".freeze
DRIBBLE =

Result set name for dribble shooting

Returns:

  • the result set name

API:

  • public

"DribbleShooting".freeze
CLOSEST_DEFENDER =

Result set name for closest defender shooting

Returns:

  • the result set name

API:

  • public

"ClosestDefenderShooting".freeze
CLOSEST_DEFENDER_10FT =

Result set name for closest defender 10ft+ shooting

Returns:

  • the result set name

API:

  • public

"ClosestDefender10ftPlusShooting".freeze
TOUCH_TIME =

Result set name for touch time shooting

Returns:

  • the result set name

API:

  • public

"TouchTimeShooting".freeze

Class Method Summary collapse

Class Method Details

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

Retrieves closest defender shot statistics for a team

Examples:

stats = NBA::TeamDashPtShots.closest_defender(team: 1610612744)
stats.each { |s| puts "#{s.shot_type}: #{s.fg_pct}" }

Parameters:

  • the team ID or Team object

  • (defaults to: Utils.current_season)

    the season year

  • (defaults to: "Regular Season")

    the season type

  • (defaults to: "PerGame")

    the per mode

  • (defaults to: CLIENT)

    the API client to use

Returns:

  • a collection of shot statistics

API:

  • public



99
100
101
102
# File 'lib/nba/team_dash_pt_shots.rb', line 99

def self.closest_defender(team:, season: Utils.current_season, season_type: "Regular Season",
  per_mode: "PerGame", client: CLIENT)
  fetch_stats(team, season, season_type, per_mode, CLOSEST_DEFENDER, client: client)
end

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

Retrieves closest defender 10ft+ shot statistics for a team

Examples:

stats = NBA::TeamDashPtShots.closest_defender_10ft(team: 1610612744)
stats.each { |s| puts "#{s.shot_type}: #{s.fg_pct}" }

Parameters:

  • the team ID or Team object

  • (defaults to: Utils.current_season)

    the season year

  • (defaults to: "Regular Season")

    the season type

  • (defaults to: "PerGame")

    the per mode

  • (defaults to: CLIENT)

    the API client to use

Returns:

  • a collection of shot statistics

API:

  • public



116
117
118
119
# File 'lib/nba/team_dash_pt_shots.rb', line 116

def self.closest_defender_10ft(team:, season: Utils.current_season, season_type: "Regular Season",
  per_mode: "PerGame", client: CLIENT)
  fetch_stats(team, season, season_type, per_mode, CLOSEST_DEFENDER_10FT, client: client)
end

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

Retrieves dribble shot statistics for a team

Examples:

stats = NBA::TeamDashPtShots.dribble(team: 1610612744)
stats.each { |s| puts "#{s.shot_type}: #{s.fg_pct}" }

Parameters:

  • the team ID or Team object

  • (defaults to: Utils.current_season)

    the season year

  • (defaults to: "Regular Season")

    the season type

  • (defaults to: "PerGame")

    the per mode

  • (defaults to: CLIENT)

    the API client to use

Returns:

  • a collection of shot statistics

API:

  • public



82
83
84
85
# File 'lib/nba/team_dash_pt_shots.rb', line 82

def self.dribble(team:, season: Utils.current_season, season_type: "Regular Season",
  per_mode: "PerGame", client: CLIENT)
  fetch_stats(team, season, season_type, per_mode, DRIBBLE, client: client)
end

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

Retrieves general shot statistics for a team

Examples:

stats = NBA::TeamDashPtShots.general(team: 1610612744)
stats.each { |s| puts "#{s.shot_type}: #{s.fg_pct}" }

Parameters:

  • the team ID or Team object

  • (defaults to: Utils.current_season)

    the season year

  • (defaults to: "Regular Season")

    the season type

  • (defaults to: "PerGame")

    the per mode

  • (defaults to: CLIENT)

    the API client to use

Returns:

  • a collection of shot statistics

API:

  • public



48
49
50
51
# File 'lib/nba/team_dash_pt_shots.rb', line 48

def self.general(team:, season: Utils.current_season, season_type: "Regular Season",
  per_mode: "PerGame", client: CLIENT)
  fetch_stats(team, season, season_type, per_mode, GENERAL, client: client)
end

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

Retrieves shot clock shot statistics for a team

Examples:

stats = NBA::TeamDashPtShots.shot_clock(team: 1610612744)
stats.each { |s| puts "#{s.shot_type}: #{s.fg_pct}" }

Parameters:

  • the team ID or Team object

  • (defaults to: Utils.current_season)

    the season year

  • (defaults to: "Regular Season")

    the season type

  • (defaults to: "PerGame")

    the per mode

  • (defaults to: CLIENT)

    the API client to use

Returns:

  • a collection of shot statistics

API:

  • public



65
66
67
68
# File 'lib/nba/team_dash_pt_shots.rb', line 65

def self.shot_clock(team:, season: Utils.current_season, season_type: "Regular Season",
  per_mode: "PerGame", client: CLIENT)
  fetch_stats(team, season, season_type, per_mode, SHOT_CLOCK, client: client)
end

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

Retrieves touch time shot statistics for a team

Examples:

stats = NBA::TeamDashPtShots.touch_time(team: 1610612744)
stats.each { |s| puts "#{s.shot_type}: #{s.fg_pct}" }

Parameters:

  • the team ID or Team object

  • (defaults to: Utils.current_season)

    the season year

  • (defaults to: "Regular Season")

    the season type

  • (defaults to: "PerGame")

    the per mode

  • (defaults to: CLIENT)

    the API client to use

Returns:

  • a collection of shot statistics

API:

  • public



133
134
135
136
# File 'lib/nba/team_dash_pt_shots.rb', line 133

def self.touch_time(team:, season: Utils.current_season, season_type: "Regular Season",
  per_mode: "PerGame", client: CLIENT)
  fetch_stats(team, season, season_type, per_mode, TOUCH_TIME, client: client)
end