Module: NBA::TeamPlayerDashboard

Defined in:
lib/nba/team_player_dashboard.rb

Overview

Provides methods to retrieve player dashboard data for a team

API:

  • public

Constant Summary collapse

PLAYERS =

Result set name for player stats

Returns:

  • the result set name

API:

  • public

"PlayersSeasonTotals".freeze
TEAM_OVERALL =

Result set name for team overall stats

Returns:

  • the result set name

API:

  • public

"TeamOverall".freeze

Class Method Summary collapse

Class Method Details

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

Retrieves player statistics for a team

Examples:

stats = NBA::TeamPlayerDashboard.players(team: NBA::Team::GSW)
stats.each { |s| puts "#{s.player_name}: #{s.pts} ppg" }

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

API:

  • public



29
30
31
# File 'lib/nba/team_player_dashboard.rb', line 29

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

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

Retrieves team overall statistics

Examples:

stats = NBA::TeamPlayerDashboard.team(team: NBA::Team::GSW)
stats.first.pts #=> 111.8

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 team overall stats

API:

  • public



45
46
47
# File 'lib/nba/team_player_dashboard.rb', line 45

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