Module: NBA::TeamPlayerDashboard

Defined in:
lib/nba/team_player_dashboard.rb

Overview

Provides methods to retrieve player dashboard data for a team

Constant Summary collapse

PLAYERS =

Result set name for player stats

"PlayersSeasonTotals".freeze
TEAM_OVERALL =

Result set name for team overall stats

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


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


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