Module: NBA::ScoreboardV3

Defined in:
lib/nba/scoreboard_v3.rb

Overview

Provides methods to retrieve NBA scoreboard data using the V3 endpoint

Class Method Summary collapse

Class Method Details

.games(date: Date.today, league: League::NBA, client: CLIENT) ⇒ Collection

Retrieves games for a specific date

Examples:

games = NBA::ScoreboardV3.games(date: Date.today)
games.each { |game| puts "#{game.away_team.name} @ #{game.home_team.name}" }

Parameters:

  • date (Date) (defaults to: Date.today)

    the date to retrieve games for (defaults to today)

  • league (League, String) (defaults to: League::NBA)

    the league ID (defaults to NBA)

  • client (Client) (defaults to: CLIENT)

    the API client to use

Returns:



23
24
25
26
27
28
# File 'lib/nba/scoreboard_v3.rb', line 23

def self.games(date: Date.today, league: League::NBA, client: CLIENT)
  league_id = Utils.extract_league_id(league)
  path = "scoreboardv3?GameDate=#{date}&LeagueID=#{league_id}"
  response = client.get(path)
  parse_scoreboard_response(response)
end