Module: NBA::TeamDetails
- Defined in:
- lib/nba/team_details.rb
Overview
Provides methods to retrieve team details
Constant Summary collapse
- TEAM_BACKGROUND =
Result set name for team background
"TeamBackground".freeze
- TEAM_HISTORY =
Result set name for team history
"TeamHistory".freeze
Class Method Summary collapse
-
.find(team:, client: CLIENT) ⇒ TeamDetail?
Retrieves detailed information for a team.
-
.history(team:, client: CLIENT) ⇒ Collection
Retrieves historical records for a team.
Class Method Details
.find(team:, client: CLIENT) ⇒ TeamDetail?
Retrieves detailed information for a team
27 28 29 30 31 32 |
# File 'lib/nba/team_details.rb', line 27 def self.find(team:, client: CLIENT) team_id = extract_team_id(team) path = "teamdetails?TeamID=#{team_id}" response = client.get(path) parse_detail_response(response) end |
.history(team:, client: CLIENT) ⇒ Collection
Retrieves historical records for a team
43 44 45 46 47 48 |
# File 'lib/nba/team_details.rb', line 43 def self.history(team:, client: CLIENT) team_id = extract_team_id(team) path = "teamdetails?TeamID=#{team_id}" response = client.get(path) parse_history_response(response) end |