Module: NBA::BoxScoreSummaryV2

Defined in:
lib/nba/box_score_summary_v2.rb

Overview

Provides methods to retrieve game summary information

Constant Summary collapse

GAME_SUMMARY =

Result set name for game summary

Returns:

  • (String)

    the result set name

"GameSummary".freeze
LINE_SCORE =

Result set name for line score

Returns:

  • (String)

    the result set name

"LineScore".freeze
OFFICIALS =

Result set name for officials

Returns:

  • (String)

    the result set name

"Officials".freeze
OTHER_STATS =

Result set name for other stats

Returns:

  • (String)

    the result set name

"OtherStats".freeze

Class Method Summary collapse

Class Method Details

.find(game:, client: CLIENT) ⇒ BoxScoreSummary?

Retrieves game summary information

Examples:

summary = NBA::BoxScoreSummaryV2.find(game: "0022400001")
puts "#{summary.home_team.full_name} #{summary.home_pts} - #{summary.visitor_pts} #{summary.visitor_team.full_name}"

Parameters:

  • game (String, Game)

    the game ID or Game object

  • client (Client) (defaults to: CLIENT)

    the API client to use

Returns:



34
35
36
37
38
39
# File 'lib/nba/box_score_summary_v2.rb', line 34

def self.find(game:, client: CLIENT)
  game_id = Utils.extract_id(game)
  path = "boxscoresummaryv2?GameID=#{game_id}"
  response = client.get(path)
  parse_response(response, game_id)
end