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

"GameSummary".freeze
LINE_SCORE =

Result set name for line score

"LineScore".freeze
OFFICIALS =

Result set name for officials

"Officials".freeze
OTHER_STATS =

Result set name for other stats

"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}"


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