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

Returns:

  • (String)

    the result set name

"OverallTeamPlayerOnOffDetails".freeze
PLAYERS_ON =

Result set name for players on court stats

Returns:

  • (String)

    the result set name

"PlayersOnCourtTeamPlayerOnOffDetails".freeze
PLAYERS_OFF =

Result set name for players off court stats

Returns:

  • (String)

    the result set name

"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" }

Parameters:

  • team (Integer, Team)

    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:



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" }

Parameters:

  • team (Integer, Team)

    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 player off court stats



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" }

Parameters:

  • team (Integer, Team)

    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 player on court stats



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