Module: NBA::TeamInfoCommon
- Defined in:
- lib/nba/team_info_common.rb
Overview
Provides methods to retrieve team information and season rankings
Constant Summary collapse
- TEAM_INFO_COMMON =
Result set name for team info
"TeamInfoCommon".freeze
- TEAM_SEASON_RANKS =
Result set name for team season ranks
"TeamSeasonRanks".freeze
- AVAILABLE_SEASONS =
Result set name for available seasons
"AvailableSeasons".freeze
Class Method Summary collapse
-
.available_seasons(team:, client: CLIENT) ⇒ Collection
Retrieves available seasons for a team.
-
.find(team:, season: Utils.current_season, season_type: nil, client: CLIENT) ⇒ TeamInfo?
Retrieves team information.
-
.ranks(team:, season: Utils.current_season, season_type: nil, client: CLIENT) ⇒ TeamSeasonRank?
Retrieves team season rankings.
Class Method Details
.available_seasons(team:, client: CLIENT) ⇒ Collection
Retrieves available seasons for a team
68 69 70 71 72 |
# File 'lib/nba/team_info_common.rb', line 68 def self.available_seasons(team:, client: CLIENT) path = build_path(team, nil, nil) response = client.get(path) parse_seasons_response(response) end |
.find(team:, season: Utils.current_season, season_type: nil, client: CLIENT) ⇒ TeamInfo?
Retrieves team information
36 37 38 39 40 |
# File 'lib/nba/team_info_common.rb', line 36 def self.find(team:, season: Utils.current_season, season_type: nil, client: CLIENT) path = build_path(team, season, season_type) response = client.get(path) parse_info_response(response) end |
.ranks(team:, season: Utils.current_season, season_type: nil, client: CLIENT) ⇒ TeamSeasonRank?
Retrieves team season rankings
53 54 55 56 57 |
# File 'lib/nba/team_info_common.rb', line 53 def self.ranks(team:, season: Utils.current_season, season_type: nil, client: CLIENT) path = build_path(team, season, season_type) response = client.get(path) parse_ranks_response(response) end |