Class: NBA::TeamGameLogStat

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

Overview

Represents a single team game log entry from the batch endpoint

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#astInteger

Returns the assists

Examples:

log.ast #=> 28


185
# File 'lib/nba/team_game_log_stat.rb', line 185

attribute :ast, Shale::Type::Integer

#blkInteger

Returns the blocks

Examples:

log.blk #=> 6


201
# File 'lib/nba/team_game_log_stat.rb', line 201

attribute :blk, Shale::Type::Integer

#drebInteger

Returns the defensive rebounds

Examples:

log.dreb #=> 35


169
# File 'lib/nba/team_game_log_stat.rb', line 169

attribute :dreb, Shale::Type::Integer

#fg3_pctFloat

Returns the three-point percentage

Examples:

log.fg3_pct #=> 0.395


129
# File 'lib/nba/team_game_log_stat.rb', line 129

attribute :fg3_pct, Shale::Type::Float

#fg3aInteger

Returns the three-pointers attempted

Examples:

log.fg3a #=> 38


121
# File 'lib/nba/team_game_log_stat.rb', line 121

attribute :fg3a, Shale::Type::Integer

#fg3mInteger

Returns the three-pointers made

Examples:

log.fg3m #=> 15


113
# File 'lib/nba/team_game_log_stat.rb', line 113

attribute :fg3m, Shale::Type::Integer

#fg_pctFloat

Returns the field goal percentage

Examples:

log.fg_pct #=> 0.477


105
# File 'lib/nba/team_game_log_stat.rb', line 105

attribute :fg_pct, Shale::Type::Float

#fgaInteger

Returns the field goals attempted

Examples:

log.fga #=> 88


97
# File 'lib/nba/team_game_log_stat.rb', line 97

attribute :fga, Shale::Type::Integer

#fgmInteger

Returns the field goals made

Examples:

log.fgm #=> 42


89
# File 'lib/nba/team_game_log_stat.rb', line 89

attribute :fgm, Shale::Type::Integer

#ft_pctFloat

Returns the free throw percentage

Examples:

log.ft_pct #=> 0.864


153
# File 'lib/nba/team_game_log_stat.rb', line 153

attribute :ft_pct, Shale::Type::Float

#ftaInteger

Returns the free throws attempted

Examples:

log.fta #=> 22


145
# File 'lib/nba/team_game_log_stat.rb', line 145

attribute :fta, Shale::Type::Integer

#ftmInteger

Returns the free throws made

Examples:

log.ftm #=> 19


137
# File 'lib/nba/team_game_log_stat.rb', line 137

attribute :ftm, Shale::Type::Integer

#game_dateString

Returns the game date

Examples:

log.game_date #=> "2024-10-22T00:00:00"


57
# File 'lib/nba/team_game_log_stat.rb', line 57

attribute :game_date, Shale::Type::String

#game_idString

Returns the game ID

Examples:

log.game_id #=> "0022400001"


49
# File 'lib/nba/team_game_log_stat.rb', line 49

attribute :game_id, Shale::Type::String

#matchupString

Returns the matchup description

Examples:

log.matchup #=> "GSW vs. LAL"


65
# File 'lib/nba/team_game_log_stat.rb', line 65

attribute :matchup, Shale::Type::String

#minInteger

Returns the minutes played

Examples:

log.min #=> 240


81
# File 'lib/nba/team_game_log_stat.rb', line 81

attribute :min, Shale::Type::Integer

#orebInteger

Returns the offensive rebounds

Examples:

log.oreb #=> 10


161
# File 'lib/nba/team_game_log_stat.rb', line 161

attribute :oreb, Shale::Type::Integer

#pfInteger

Returns the personal fouls

Examples:

log.pf #=> 20


217
# File 'lib/nba/team_game_log_stat.rb', line 217

attribute :pf, Shale::Type::Integer

#plus_minusInteger

Returns the plus/minus

Examples:

log.plus_minus #=> 9


233
# File 'lib/nba/team_game_log_stat.rb', line 233

attribute :plus_minus, Shale::Type::Integer

#ptsInteger

Returns the points scored

Examples:

log.pts #=> 118


225
# File 'lib/nba/team_game_log_stat.rb', line 225

attribute :pts, Shale::Type::Integer

#rebInteger

Returns the total rebounds

Examples:

log.reb #=> 45


177
# File 'lib/nba/team_game_log_stat.rb', line 177

attribute :reb, Shale::Type::Integer

#season_yearString

Returns the season year

Examples:

log.season_year #=> "2024-25"


17
# File 'lib/nba/team_game_log_stat.rb', line 17

attribute :season_year, Shale::Type::String

#stlInteger

Returns the steals

Examples:

log.stl #=> 9


193
# File 'lib/nba/team_game_log_stat.rb', line 193

attribute :stl, Shale::Type::Integer

#team_abbreviationString

Returns the team abbreviation

Examples:

log.team_abbreviation #=> "GSW"


33
# File 'lib/nba/team_game_log_stat.rb', line 33

attribute :team_abbreviation, Shale::Type::String

#team_idInteger

Returns the team ID

Examples:

log.team_id #=> 1610612744


25
# File 'lib/nba/team_game_log_stat.rb', line 25

attribute :team_id, Shale::Type::Integer

#team_nameString

Returns the team name

Examples:

log.team_name #=> "Warriors"


41
# File 'lib/nba/team_game_log_stat.rb', line 41

attribute :team_name, Shale::Type::String

#tovInteger

Returns the turnovers

Examples:

log.tov #=> 14


209
# File 'lib/nba/team_game_log_stat.rb', line 209

attribute :tov, Shale::Type::Integer

#wlString

Returns the win/loss indicator

Examples:

log.wl #=> "W"


73
# File 'lib/nba/team_game_log_stat.rb', line 73

attribute :wl, Shale::Type::String

Instance Method Details

#gameGame?

Returns the game object for this log entry

Examples:

log.game #=> #<NBA::Game>


261
262
263
# File 'lib/nba/team_game_log_stat.rb', line 261

def game
  Games.find(game_id)
end

#loss?Boolean

Returns whether the game was a loss

Examples:

log.loss? #=> false


251
252
253
# File 'lib/nba/team_game_log_stat.rb', line 251

def loss?
  wl.eql?("L")
end

#teamTeam?

Returns the team object for this log entry

Examples:

log.team #=> #<NBA::Team>


271
272
273
# File 'lib/nba/team_game_log_stat.rb', line 271

def team
  Teams.find(team_id)
end

#win?Boolean

Returns whether the game was a win

Examples:

log.win? #=> true


241
242
243
# File 'lib/nba/team_game_log_stat.rb', line 241

def win?
  wl.eql?("W")
end