Module: NBA::PlayByPlay
- Defined in:
- lib/nba/play_by_play.rb
Overview
Provides methods to retrieve play-by-play data for games
Constant Summary collapse
- RESULT_SET_NAME =
Result set name for play-by-play data
"PlayByPlay".freeze
Class Method Summary collapse
-
.find(game:, start_period: 1, end_period: 10, client: CLIENT) ⇒ Collection
Retrieves play-by-play data for a game.
Class Method Details
.find(game:, start_period: 1, end_period: 10, client: CLIENT) ⇒ Collection
Retrieves play-by-play data for a game
24 25 26 27 |
# File 'lib/nba/play_by_play.rb', line 24 def self.find(game:, start_period: 1, end_period: 10, client: CLIENT) path = "playbyplayv2?GameID=#{Utils.extract_id(game)}&StartPeriod=#{start_period}&EndPeriod=#{end_period}" ResponseParser.parse(client.get(path), result_set: RESULT_SET_NAME) { |data| build_play(data) } end |