Class: NBA::BoxScoreSummaryV3Data

Inherits:
Shale::Mapper
  • Object
show all
Defined in:
lib/nba/box_score_summary_v3_data.rb

Overview

Represents game summary information from V3 API

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#arena_cityString

Returns the arena city

Examples:

summary.arena_city #=> "San Francisco"

Returns:

  • (String)

    the arena city



119
# File 'lib/nba/box_score_summary_v3_data.rb', line 119

attribute :arena_city, Shale::Type::String

#arena_countryString

Returns the arena country

Examples:

summary.arena_country #=> "US"

Returns:

  • (String)

    the arena country



135
# File 'lib/nba/box_score_summary_v3_data.rb', line 135

attribute :arena_country, Shale::Type::String

#arena_idInteger

Returns the arena ID

Examples:

summary.arena_id #=> 10

Returns:

  • (Integer)

    the arena ID



103
# File 'lib/nba/box_score_summary_v3_data.rb', line 103

attribute :arena_id, Shale::Type::Integer

#arena_nameString

Returns the arena name

Examples:

summary.arena_name #=> "Chase Center"

Returns:

  • (String)

    the arena name



111
# File 'lib/nba/box_score_summary_v3_data.rb', line 111

attribute :arena_name, Shale::Type::String

#arena_stateString

Returns the arena state

Examples:

summary.arena_state #=> "CA"

Returns:

  • (String)

    the arena state



127
# File 'lib/nba/box_score_summary_v3_data.rb', line 127

attribute :arena_state, Shale::Type::String

#arena_timezoneString

Returns the arena timezone

Examples:

summary.arena_timezone #=> "America/Los_Angeles"

Returns:

  • (String)

    the arena timezone



143
# File 'lib/nba/box_score_summary_v3_data.rb', line 143

attribute :arena_timezone, Shale::Type::String

#attendanceInteger

Returns the attendance

Examples:

summary.attendance #=> 18064

Returns:

  • (Integer)

    the attendance



87
# File 'lib/nba/box_score_summary_v3_data.rb', line 87

attribute :attendance, Shale::Type::Integer

#away_ptsInteger

Returns away team total points

Examples:

summary.away_pts #=> 109

Returns:

  • (Integer)

    total points



303
# File 'lib/nba/box_score_summary_v3_data.rb', line 303

attribute :away_pts, Shale::Type::Integer

#away_pts_q1Integer

Returns away team Q1 points

Examples:

summary.away_pts_q1 #=> 25

Returns:

  • (Integer)

    Q1 points



311
# File 'lib/nba/box_score_summary_v3_data.rb', line 311

attribute :away_pts_q1, Shale::Type::Integer

#away_pts_q2Integer

Returns away team Q2 points

Examples:

summary.away_pts_q2 #=> 28

Returns:

  • (Integer)

    Q2 points



319
# File 'lib/nba/box_score_summary_v3_data.rb', line 319

attribute :away_pts_q2, Shale::Type::Integer

#away_pts_q3Integer

Returns away team Q3 points

Examples:

summary.away_pts_q3 #=> 30

Returns:

  • (Integer)

    Q3 points



327
# File 'lib/nba/box_score_summary_v3_data.rb', line 327

attribute :away_pts_q3, Shale::Type::Integer

#away_pts_q4Integer

Returns away team Q4 points

Examples:

summary.away_pts_q4 #=> 26

Returns:

  • (Integer)

    Q4 points



335
# File 'lib/nba/box_score_summary_v3_data.rb', line 335

attribute :away_pts_q4, Shale::Type::Integer

#away_team_cityString

Returns the away team city

Examples:

summary.away_team_city #=> "Los Angeles"

Returns:

  • (String)

    the away team city



263
# File 'lib/nba/box_score_summary_v3_data.rb', line 263

attribute :away_team_city, Shale::Type::String

#away_team_idInteger

Returns the away team ID

Examples:

summary.away_team_id #=> 1610612747

Returns:

  • (Integer)

    the away team ID



247
# File 'lib/nba/box_score_summary_v3_data.rb', line 247

attribute :away_team_id, Shale::Type::Integer

#away_team_lossesInteger

Returns the away team losses

Examples:

summary.away_team_losses #=> 1

Returns:

  • (Integer)

    the away team losses



295
# File 'lib/nba/box_score_summary_v3_data.rb', line 295

attribute :away_team_losses, Shale::Type::Integer

#away_team_nameString

Returns the away team name

Examples:

summary.away_team_name #=> "Lakers"

Returns:

  • (String)

    the away team name



255
# File 'lib/nba/box_score_summary_v3_data.rb', line 255

attribute :away_team_name, Shale::Type::String

#away_team_slugString

Returns the away team slug

Examples:

summary.away_team_slug #=> "lakers"

Returns:

  • (String)

    the away team slug



279
# File 'lib/nba/box_score_summary_v3_data.rb', line 279

attribute :away_team_slug, Shale::Type::String

#away_team_tricodeString

Returns the away team tricode

Examples:

summary.away_team_tricode #=> "LAL"

Returns:

  • (String)

    the away team tricode



271
# File 'lib/nba/box_score_summary_v3_data.rb', line 271

attribute :away_team_tricode, Shale::Type::String

#away_team_winsInteger

Returns the away team wins

Examples:

summary.away_team_wins #=> 0

Returns:

  • (Integer)

    the away team wins



287
# File 'lib/nba/box_score_summary_v3_data.rb', line 287

attribute :away_team_wins, Shale::Type::Integer

#durationInteger

Returns the game duration in minutes

Examples:

summary.duration #=> 138

Returns:

  • (Integer)

    the duration



79
# File 'lib/nba/box_score_summary_v3_data.rb', line 79

attribute :duration, Shale::Type::Integer

#game_clockString

Returns the game clock time

Examples:

summary.game_clock #=> "PT00M00.00S"

Returns:

  • (String)

    the game clock



55
# File 'lib/nba/box_score_summary_v3_data.rb', line 55

attribute :game_clock, Shale::Type::String

#game_codeString

Returns the game code

Examples:

summary.game_code #=> "20241022/LALGSW"

Returns:

  • (String)

    the game code



23
# File 'lib/nba/box_score_summary_v3_data.rb', line 23

attribute :game_code, Shale::Type::String

#game_etString

Returns the game time in Eastern Time

Examples:

summary.game_et #=> "2024-10-22T22:00:00"

Returns:

  • (String)

    the game time ET



71
# File 'lib/nba/box_score_summary_v3_data.rb', line 71

attribute :game_et, Shale::Type::String

#game_idString

Returns the game ID

Examples:

summary.game_id #=> "0022400001"

Returns:

  • (String)

    the game ID



15
# File 'lib/nba/box_score_summary_v3_data.rb', line 15

attribute :game_id, Shale::Type::String

#game_statusInteger

Returns the game status ID

Examples:

summary.game_status #=> 3

Returns:

  • (Integer)

    the status ID



31
# File 'lib/nba/box_score_summary_v3_data.rb', line 31

attribute :game_status, Shale::Type::Integer

#game_status_textString

Returns the game status text

Examples:

summary.game_status_text #=> "Final"

Returns:

  • (String)

    the status text



39
# File 'lib/nba/box_score_summary_v3_data.rb', line 39

attribute :game_status_text, Shale::Type::String

#game_time_utcString

Returns the game time in UTC

Examples:

summary.game_time_utc #=> "2024-10-23T02:00:00Z"

Returns:

  • (String)

    the game time UTC



63
# File 'lib/nba/box_score_summary_v3_data.rb', line 63

attribute :game_time_utc, Shale::Type::String

#home_ptsInteger

Returns home team total points

Examples:

summary.home_pts #=> 118

Returns:

  • (Integer)

    total points



207
# File 'lib/nba/box_score_summary_v3_data.rb', line 207

attribute :home_pts, Shale::Type::Integer

#home_pts_q1Integer

Returns home team Q1 points

Examples:

summary.home_pts_q1 #=> 28

Returns:

  • (Integer)

    Q1 points



215
# File 'lib/nba/box_score_summary_v3_data.rb', line 215

attribute :home_pts_q1, Shale::Type::Integer

#home_pts_q2Integer

Returns home team Q2 points

Examples:

summary.home_pts_q2 #=> 32

Returns:

  • (Integer)

    Q2 points



223
# File 'lib/nba/box_score_summary_v3_data.rb', line 223

attribute :home_pts_q2, Shale::Type::Integer

#home_pts_q3Integer

Returns home team Q3 points

Examples:

summary.home_pts_q3 #=> 25

Returns:

  • (Integer)

    Q3 points



231
# File 'lib/nba/box_score_summary_v3_data.rb', line 231

attribute :home_pts_q3, Shale::Type::Integer

#home_pts_q4Integer

Returns home team Q4 points

Examples:

summary.home_pts_q4 #=> 33

Returns:

  • (Integer)

    Q4 points



239
# File 'lib/nba/box_score_summary_v3_data.rb', line 239

attribute :home_pts_q4, Shale::Type::Integer

#home_team_cityString

Returns the home team city

Examples:

summary.home_team_city #=> "Golden State"

Returns:

  • (String)

    the home team city



167
# File 'lib/nba/box_score_summary_v3_data.rb', line 167

attribute :home_team_city, Shale::Type::String

#home_team_idInteger

Returns the home team ID

Examples:

summary.home_team_id #=> 1610612744

Returns:

  • (Integer)

    the home team ID



151
# File 'lib/nba/box_score_summary_v3_data.rb', line 151

attribute :home_team_id, Shale::Type::Integer

#home_team_lossesInteger

Returns the home team losses

Examples:

summary.home_team_losses #=> 0

Returns:

  • (Integer)

    the home team losses



199
# File 'lib/nba/box_score_summary_v3_data.rb', line 199

attribute :home_team_losses, Shale::Type::Integer

#home_team_nameString

Returns the home team name

Examples:

summary.home_team_name #=> "Warriors"

Returns:

  • (String)

    the home team name



159
# File 'lib/nba/box_score_summary_v3_data.rb', line 159

attribute :home_team_name, Shale::Type::String

#home_team_slugString

Returns the home team slug

Examples:

summary.home_team_slug #=> "warriors"

Returns:

  • (String)

    the home team slug



183
# File 'lib/nba/box_score_summary_v3_data.rb', line 183

attribute :home_team_slug, Shale::Type::String

#home_team_tricodeString

Returns the home team tricode

Examples:

summary.home_team_tricode #=> "GSW"

Returns:

  • (String)

    the home team tricode



175
# File 'lib/nba/box_score_summary_v3_data.rb', line 175

attribute :home_team_tricode, Shale::Type::String

#home_team_winsInteger

Returns the home team wins

Examples:

summary.home_team_wins #=> 1

Returns:

  • (Integer)

    the home team wins



191
# File 'lib/nba/box_score_summary_v3_data.rb', line 191

attribute :home_team_wins, Shale::Type::Integer

#largest_leadInteger

Returns the largest lead

Examples:

summary.largest_lead #=> 15

Returns:

  • (Integer)

    largest lead



359
# File 'lib/nba/box_score_summary_v3_data.rb', line 359

attribute :largest_lead, Shale::Type::Integer

#lead_changesInteger

Returns the number of lead changes

Examples:

summary.lead_changes #=> 12

Returns:

  • (Integer)

    lead changes



343
# File 'lib/nba/box_score_summary_v3_data.rb', line 343

attribute :lead_changes, Shale::Type::Integer

#officialsArray<String>

Returns the game officials

Examples:

summary.officials #=> ["Scott Foster", "Tony Brothers", "Marc Davis"]

Returns:

  • (Array<String>)

    the officials



367
# File 'lib/nba/box_score_summary_v3_data.rb', line 367

attribute :officials, Shale::Type::String, collection: true

#periodInteger

Returns the current period

Examples:

summary.period #=> 4

Returns:

  • (Integer)

    the period



47
# File 'lib/nba/box_score_summary_v3_data.rb', line 47

attribute :period, Shale::Type::Integer

#selloutString

Returns the sellout status

Examples:

summary.sellout #=> "1"

Returns:

  • (String)

    the sellout status



95
# File 'lib/nba/box_score_summary_v3_data.rb', line 95

attribute :sellout, Shale::Type::String

#times_tiedInteger

Returns the number of times tied

Examples:

summary.times_tied #=> 8

Returns:

  • (Integer)

    times tied



351
# File 'lib/nba/box_score_summary_v3_data.rb', line 351

attribute :times_tied, Shale::Type::Integer

Instance Method Details

#away_teamTeam?

Returns the away team object

Examples:

summary.away_team #=> #<NBA::Team>

Returns:

  • (Team, nil)

    the away team



385
386
387
# File 'lib/nba/box_score_summary_v3_data.rb', line 385

def away_team
  Teams.find(away_team_id)
end

#final?Boolean

Returns whether the game is final

Examples:

summary.final? #=> true

Returns:

  • (Boolean)

    true if final



395
396
397
# File 'lib/nba/box_score_summary_v3_data.rb', line 395

def final?
  game_status.eql?(3)
end

#home_teamTeam?

Returns the home team object

Examples:

summary.home_team #=> #<NBA::Team>

Returns:

  • (Team, nil)

    the home team



375
376
377
# File 'lib/nba/box_score_summary_v3_data.rb', line 375

def home_team
  Teams.find(home_team_id)
end

#in_progress?Boolean

Returns whether the game is in progress

Examples:

summary.in_progress? #=> false

Returns:

  • (Boolean)

    true if in progress



405
406
407
# File 'lib/nba/box_score_summary_v3_data.rb', line 405

def in_progress?
  game_status.eql?(2)
end

#scheduled?Boolean

Returns whether the game has not started

Examples:

summary.scheduled? #=> false

Returns:

  • (Boolean)

    true if scheduled



415
416
417
# File 'lib/nba/box_score_summary_v3_data.rb', line 415

def scheduled?
  game_status.eql?(1)
end