Module: NBA::TeamGameLogs

Defined in:
lib/nba/team_game_logs.rb

Overview

Provides methods to retrieve team game logs in batch

Constant Summary collapse

REGULAR_SEASON =

Regular season type

"Regular Season".freeze
PLAYOFFS =

Playoffs season type

"Playoffs".freeze
PER_GAME =

Per game mode

"PerGame".freeze
TOTALS =

Totals mode

"Totals".freeze
RESULT_SET_NAME =

Result set name

"TeamGameLogs".freeze

Class Method Summary collapse

Class Method Details

.all(season: Utils.current_season, season_type: REGULAR_SEASON, team: nil, per_mode: PER_GAME, client: CLIENT) ⇒ Collection

Retrieves game logs for all teams matching the criteria

Examples:

logs = NBA::TeamGameLogs.all(season: 2024)
logs.each { |log| puts "#{log.game_date}: #{log.team_name} - #{log.pts} pts" }


44
45
46
47
48
49
# File 'lib/nba/team_game_logs.rb', line 44

def self.all(season: Utils.current_season, season_type: REGULAR_SEASON, team: nil,
  per_mode: PER_GAME, client: CLIENT)
  path = build_path(season, season_type, team, per_mode)
  response = client.get(path)
  parse_response(response)
end