Module: NBA::LeagueStandings
- Defined in:
- lib/nba/league_standings.rb
Overview
Provides methods to retrieve league standings with extended data
Constant Summary collapse
- STANDINGS =
Result set name for standings
"Standings".freeze
- REGULAR_SEASON =
Season type constant for regular season
"Regular Season".freeze
Class Method Summary collapse
-
.all(season: Utils.current_season, season_type: REGULAR_SEASON, league: League::NBA, client: CLIENT) ⇒ Collection
Retrieves all league standings.
-
.conference(conference_name, season: Utils.current_season, season_type: REGULAR_SEASON, league: League::NBA, client: CLIENT) ⇒ Collection
Retrieves standings for a specific conference.
Class Method Details
.all(season: Utils.current_season, season_type: REGULAR_SEASON, league: League::NBA, client: CLIENT) ⇒ Collection
Retrieves all league standings
30 31 32 33 34 35 |
# File 'lib/nba/league_standings.rb', line 30 def self.all(season: Utils.current_season, season_type: REGULAR_SEASON, league: League::NBA, client: CLIENT) league_id = Utils.extract_league_id(league) path = build_path(season, season_type, league_id) response = client.get(path) parse_response(response) end |
.conference(conference_name, season: Utils.current_season, season_type: REGULAR_SEASON, league: League::NBA, client: CLIENT) ⇒ Collection
Retrieves standings for a specific conference
49 50 51 52 53 54 |
# File 'lib/nba/league_standings.rb', line 49 def self.conference(conference_name, season: Utils.current_season, season_type: REGULAR_SEASON, league: League::NBA, client: CLIENT) all_standings = all(season: season, season_type: season_type, league: league, client: client) filtered = all_standings.select { |s| s.conference.eql?(conference_name) } Collection.new(filtered) end |