Module: NBA::PlayerCompare
- Defined in:
- lib/nba/player_compare.rb
Overview
Provides methods to compare two players
Constant Summary collapse
- OVERALL_COMPARE =
Result set name for overall comparison
"OverallCompare".freeze
- REGULAR_SEASON =
Season type constant for regular season
"Regular Season".freeze
- PLAYOFFS =
Season type constant for playoffs
"Playoffs".freeze
Class Method Summary collapse
-
.compare(player:, vs_player:, season: Utils.current_season, season_type: REGULAR_SEASON, client: CLIENT) ⇒ Collection
Compares two players overall stats.
Class Method Details
.compare(player:, vs_player:, season: Utils.current_season, season_type: REGULAR_SEASON, client: CLIENT) ⇒ Collection
Compares two players overall stats
39 40 41 42 43 44 45 |
# File 'lib/nba/player_compare.rb', line 39 def self.compare(player:, vs_player:, season: Utils.current_season, season_type: REGULAR_SEASON, client: CLIENT) player_id = extract_player_id(player) vs_player_id = extract_player_id(vs_player) path = build_path(player_id, vs_player_id, season, season_type) response = client.get(path) parse_response(response) end |