Module: NBA::Standings
- Defined in:
- lib/nba/standings.rb
Overview
Provides methods to retrieve NBA standings
Class Method Summary collapse
-
.all(season: Utils.current_season, client: CLIENT) ⇒ Collection
Retrieves all team standings.
-
.conference(conference_name, season: Utils.current_season, client: CLIENT) ⇒ Collection
Retrieves standings for a specific conference.
Class Method Details
.all(season: Utils.current_season, client: CLIENT) ⇒ Collection
Retrieves all team standings
18 19 20 21 |
# File 'lib/nba/standings.rb', line 18 def self.all(season: Utils.current_season, client: CLIENT) path = "leaguestandings?LeagueID=00&Season=#{Utils.format_season(season)}&SeasonType=Regular+Season" ResponseParser.parse(client.get(path)) { |data| build_standing(data) } end |
.conference(conference_name, season: Utils.current_season, client: CLIENT) ⇒ Collection
Retrieves standings for a specific conference
32 33 34 |
# File 'lib/nba/standings.rb', line 32 def self.conference(conference_name, season: Utils.current_season, client: CLIENT) Collection.new(all(season: season, client: client).select { |s| s.conference.eql?(conference_name) }) end |