Module: NBA::TeamPlayerOnOffDetails

Defined in:
lib/nba/team_player_on_off_details.rb

Overview

Provides methods to retrieve team on/off court details

Constant Summary collapse

OVERALL =

Result set name for overall team stats

"OverallTeamPlayerOnOffDetails".freeze
PLAYERS_ON =

Result set name for players on court stats

"PlayersOnCourtTeamPlayerOnOffDetails".freeze
PLAYERS_OFF =

Result set name for players off court stats

"PlayersOffCourtTeamPlayerOnOffDetails".freeze

Class Method Summary collapse

Class Method Details

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

Retrieves overall team on/off court statistics

Examples:

stats = NBA::TeamPlayerOnOffDetails.overall(team: NBA::Team::GSW)
stats.each { |s| puts "#{s.group_value}: #{s.pts} pts" }


31
32
33
# File 'lib/nba/team_player_on_off_details.rb', line 31

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

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

Retrieves statistics when opponent players are off the court

Examples:

stats = NBA::TeamPlayerOnOffDetails.players_off_court(team: NBA::Team::GSW)
stats.each { |s| puts "#{s.vs_player_name}: #{s.pts} pts" }


63
64
65
# File 'lib/nba/team_player_on_off_details.rb', line 63

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

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

Retrieves statistics when opponent players are on the court

Examples:

stats = NBA::TeamPlayerOnOffDetails.players_on_court(team: NBA::Team::GSW)
stats.each { |s| puts "#{s.vs_player_name}: #{s.pts} pts" }


47
48
49
# File 'lib/nba/team_player_on_off_details.rb', line 47

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