Module: NBA::HomePageV2
- Defined in:
- lib/nba/home_page_v2.rb
Overview
Provides methods to retrieve NBA home page V2 statistics
Constant Summary collapse
- STAT_CATEGORIES =
Stat categories available in home page V2
{ pts: "HomePageStat1", reb: "HomePageStat2", ast: "HomePageStat3", stl: "HomePageStat4", fg_pct: "HomePageStat5", ft_pct: "HomePageStat6", fg3_pct: "HomePageStat7", blk: "HomePageStat8" }.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", stat_type: "Traditional", league: League::NBA, client: CLIENT) ⇒ Collection
Retrieves home page V2 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", stat_type: "Traditional", league: League::NBA, client: CLIENT) ⇒ Collection
Retrieves home page V2 statistics for a stat category
40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/nba/home_page_v2.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", stat_type: "Traditional", 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, stat_type: stat_type, league_id: league_id} response = client.get(build_path(opts)) parse_response(response, result_set, stat_category) end |