Module: NBA::DefenseHub
- Defined in:
- lib/nba/defense_hub.rb
Overview
Provides methods to retrieve NBA defense hub statistics
Constant Summary collapse
- STAT_CATEGORIES =
Stat categories available in the defense hub
{ dreb: "DefenseHubStat1", stl: "DefenseHubStat2", blk: "DefenseHubStat3", def_rating: "DefenseHubStat4", overall_pm: "DefenseHubStat5", threep_dfg_pct: "DefenseHubStat6", twop_dfg_pct: "DefenseHubStat7", fifteenf_dfg_pct: "DefenseHubStat8", def_rim_pct: "DefenseHubStat9" }.freeze
Class Method Summary collapse
-
.all(stat_category:, season: Utils.current_season, season_type: "Regular Season", game_scope: "Season", player_or_team: "Team", player_scope: "All Players", league: League::NBA, client: CLIENT) ⇒ Collection
Retrieves defense hub statistics for a stat category.
Class Method Details
.all(stat_category:, season: Utils.current_season, season_type: "Regular Season", game_scope: "Season", player_or_team: "Team", player_scope: "All Players", league: League::NBA, client: CLIENT) ⇒ Collection
Retrieves defense hub statistics for a stat category
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/nba/defense_hub.rb', line 40 def self.all(stat_category:, season: Utils.current_season, season_type: "Regular Season", game_scope: "Season", player_or_team: "Team", player_scope: "All Players", league: League::NBA, client: CLIENT) result_set = STAT_CATEGORIES.fetch(stat_category) league_id = Utils.extract_league_id(league) opts = {season: season, season_type: season_type, game_scope: game_scope, player_or_team: player_or_team, player_scope: player_scope, league_id: league_id} response = client.get(build_path(opts)) parse_response(response, result_set, stat_category) end |