Module: NBA::PlayerCareerStats
- Defined in:
- lib/nba/player_career_stats.rb
Overview
Provides methods to retrieve player career statistics
Constant Summary collapse
- PER_GAME =
Regular season per game stats type
"PerGame".freeze
- TOTALS =
Totals stats type
"Totals".freeze
- RESULT_SET_NAME =
Result set name for regular season stats
"SeasonTotalsRegularSeason".freeze
Class Method Summary collapse
-
.find(player:, per_mode: PER_GAME, client: CLIENT) ⇒ Collection
Retrieves career statistics for a player.
Class Method Details
.find(player:, per_mode: PER_GAME, client: CLIENT) ⇒ Collection
Retrieves career statistics for a player
31 32 33 34 35 36 37 |
# File 'lib/nba/player_career_stats.rb', line 31 def self.find(player:, per_mode: PER_GAME, client: CLIENT) player_id = Utils.extract_id(player) path = "playercareerstats?PlayerID=#{player_id}&PerMode=#{per_mode}" ResponseParser.parse(client.get(path), result_set: RESULT_SET_NAME) do |data| build_career_stats(data, player_id) end end |