Module: NBA::PlayerNextNGames
- Defined in:
- lib/nba/player_next_n_games.rb
Overview
Provides methods to retrieve a player’s upcoming games
Constant Summary collapse
- RESULT_SET_NAME =
Result set name
"NextNGames".freeze
Class Method Summary collapse
-
.find(player:, number_of_games: 5, client: CLIENT) ⇒ Collection
Retrieves upcoming games for a player.
Class Method Details
.find(player:, number_of_games: 5, client: CLIENT) ⇒ Collection
Retrieves upcoming games for a player
25 26 27 28 29 |
# File 'lib/nba/player_next_n_games.rb', line 25 def self.find(player:, number_of_games: 5, client: CLIENT) id = Utils.extract_id(player) path = "playernextngames?PlayerID=#{id}&NumberOfGames=#{number_of_games}&LeagueID=00" ResponseParser.parse(client.get(path), result_set: RESULT_SET_NAME) { |data| build_game(data) } end |