Module: NBA::BoxScoreAdvanced
- Defined in:
- lib/nba/box_score_advanced.rb
Overview
Provides methods to retrieve advanced box score statistics
Constant Summary collapse
- PLAYER_STATS =
Result set name for player stats
"PlayerStats".freeze
- TEAM_STATS =
Result set name for team stats
"TeamStats".freeze
Class Method Summary collapse
-
.player_stats(game:, client: CLIENT) ⇒ Collection
Retrieves player advanced box score stats for a game.
-
.team_stats(game:, client: CLIENT) ⇒ Collection
Retrieves team advanced box score stats for a game.
Class Method Details
.player_stats(game:, client: CLIENT) ⇒ Collection
Retrieves player advanced box score stats for a game
27 28 29 30 |
# File 'lib/nba/box_score_advanced.rb', line 27 def self.player_stats(game:, client: CLIENT) path = "boxscoreadvancedv2?GameID=#{Utils.extract_id(game)}" ResponseParser.parse(client.get(path), result_set: PLAYER_STATS) { |data| build_player_stat(data) } end |
.team_stats(game:, client: CLIENT) ⇒ Collection
Retrieves team advanced box score stats for a game
41 42 43 44 |
# File 'lib/nba/box_score_advanced.rb', line 41 def self.team_stats(game:, client: CLIENT) path = "boxscoreadvancedv2?GameID=#{Utils.extract_id(game)}" ResponseParser.parse(client.get(path), result_set: TEAM_STATS) { |data| build_team_stat(data) } end |