Module: NBA::PlayoffPicture

Defined in:
lib/nba/playoff_picture.rb

Overview

Provides methods to retrieve NBA playoff picture data

API:

  • public

Class Method Summary collapse

Class Method Details

.all(season: Utils.current_season, league: League::NBA, client: CLIENT) ⇒ Collection

Retrieves playoff matchups for both conferences

Examples:

matchups = NBA::PlayoffPicture.all(season: 2023)
matchups.each { |m| puts "#{m.high_seed_team} vs #{m.low_seed_team}" }

Parameters:

  • (defaults to: Utils.current_season)

    the season year (defaults to current season)

  • (defaults to: League::NBA)

    the league ID or League object

  • (defaults to: CLIENT)

    the API client to use

Returns:

  • a collection of playoff matchups

API:

  • public



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

def self.all(season: Utils.current_season, league: League::NBA, client: CLIENT)
  league_id = Utils.extract_league_id(league)
  season_id = Utils.format_season_id(season)
  path = "playoffpicture?LeagueID=#{league_id}&SeasonID=#{season_id}"
  response = client.get(path)
  parse_playoff_picture(response)
end