Module: NBA::BoxScoreMatchupsV3

Defined in:
lib/nba/box_score_matchups_v3.rb

Overview

Provides methods to retrieve player matchup statistics using V3 API

Constant Summary collapse

BOX_SCORE_KEY =

Returns JSON key for matchup box score data.

Returns:

  • (String)

    JSON key for matchup box score data

"boxScoreMatchups".freeze
PLAYER_STATS =

Returns JSON key for player stats result set.

Returns:

  • (String)

    JSON key for player stats result set

"PlayerStats".freeze

Class Method Summary collapse

Class Method Details

.find(game:, client: CLIENT) ⇒ Collection

Retrieves player matchup stats for a game

Examples:

stats = NBA::BoxScoreMatchupsV3.find(game: "0022400001")
stats.each { |stat| puts "#{stat.first_name_off} vs #{stat.first_name_def}" }

Parameters:

  • game (String, Integer, Game)

    the game ID or Game object

  • client (Client) (defaults to: CLIENT)

    the API client to use

Returns:

  • (Collection)

    a collection of player matchup stats



24
25
26
27
28
# File 'lib/nba/box_score_matchups_v3.rb', line 24

def self.find(game:, client: CLIENT)
  game_id = Utils.extract_id(game)
  response = client.get(build_path(game_id))
  parse_response(response, game_id)
end