Module: NBA::IstStandings

Defined in:
lib/nba/ist_standings.rb

Overview

Provides methods to retrieve NBA In-Season Tournament standings

Constant Summary collapse

RESULT_SET =

Result set name for IST standings

Returns:

  • (String)

    the result set name

"Standings".freeze

Class Method Summary collapse

Class Method Details

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

Retrieves In-Season Tournament standings for a season

Examples:

standings = NBA::IstStandings.all(season: 2023)
standings.each { |s| puts "#{s.team_name}: #{s.wins}-#{s.losses}" }

Parameters:

  • season (Integer) (defaults to: Utils.current_season)

    the season year (defaults to current season)

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

    the league ID or League object (default NBA)

  • client (Client) (defaults to: CLIENT)

    the API client to use

Returns:



25
26
27
28
29
# File 'lib/nba/ist_standings.rb', line 25

def self.all(season: Utils.current_season, league: League::NBA, client: CLIENT)
  league_id = Utils.extract_league_id(league)
  path = build_path(season, league_id)
  ResponseParser.parse(client.get(path), result_set: RESULT_SET) { |data| build_standing(data) }
end