Module: NBA::ShotChart
- Defined in:
- lib/nba/shot_chart.rb
Overview
Provides methods to retrieve shot chart data
Constant Summary collapse
- RESULT_SET_NAME =
Result set name for shot chart detail
"Shot_Chart_Detail".freeze
Class Method Summary collapse
-
.find(player:, team:, season: Utils.current_season, client: CLIENT) ⇒ Collection
Retrieves shot chart data for a player.
Class Method Details
.find(player:, team:, season: Utils.current_season, client: CLIENT) ⇒ Collection
Retrieves shot chart data for a player
24 25 26 27 28 |
# File 'lib/nba/shot_chart.rb', line 24 def self.find(player:, team:, season: Utils.current_season, client: CLIENT) path = "shotchartdetail?PlayerID=#{Utils.extract_id(player)}&TeamID=#{Utils.extract_id(team)}" \ "&Season=#{Utils.format_season(season)}&ContextMeasure=FGA" ResponseParser.parse(client.get(path), result_set: RESULT_SET_NAME) { |data| build_shot(data) } end |