Class: NBA::TeamGameLogEntry

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

Overview

Represents a single team game log entry

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#astInteger

Returns assists

Examples:

log.ast #=> 28


156
# File 'lib/nba/team_game_log_entry.rb', line 156

attribute :ast, Shale::Type::Integer

#blkInteger

Returns blocks

Examples:

log.blk #=> 5


172
# File 'lib/nba/team_game_log_entry.rb', line 172

attribute :blk, Shale::Type::Integer

#drebInteger

Returns defensive rebounds

Examples:

log.dreb #=> 35


140
# File 'lib/nba/team_game_log_entry.rb', line 140

attribute :dreb, Shale::Type::Integer

#fg3_pctFloat

Returns three-point percentage

Examples:

log.fg3_pct #=> 0.375


100
# File 'lib/nba/team_game_log_entry.rb', line 100

attribute :fg3_pct, Shale::Type::Float

#fg3aInteger

Returns three-pointers attempted

Examples:

log.fg3a #=> 40


92
# File 'lib/nba/team_game_log_entry.rb', line 92

attribute :fg3a, Shale::Type::Integer

#fg3mInteger

Returns three-pointers made

Examples:

log.fg3m #=> 15


84
# File 'lib/nba/team_game_log_entry.rb', line 84

attribute :fg3m, Shale::Type::Integer

#fg_pctFloat

Returns field goal percentage

Examples:

log.fg_pct #=> 0.477


76
# File 'lib/nba/team_game_log_entry.rb', line 76

attribute :fg_pct, Shale::Type::Float

#fgaInteger

Returns field goals attempted

Examples:

log.fga #=> 88


68
# File 'lib/nba/team_game_log_entry.rb', line 68

attribute :fga, Shale::Type::Integer

#fgmInteger

Returns field goals made

Examples:

log.fgm #=> 42


60
# File 'lib/nba/team_game_log_entry.rb', line 60

attribute :fgm, Shale::Type::Integer

#ft_pctFloat

Returns free throw percentage

Examples:

log.ft_pct #=> 0.800


124
# File 'lib/nba/team_game_log_entry.rb', line 124

attribute :ft_pct, Shale::Type::Float

#ftaInteger

Returns free throws attempted

Examples:

log.fta #=> 25


116
# File 'lib/nba/team_game_log_entry.rb', line 116

attribute :fta, Shale::Type::Integer

#ftmInteger

Returns free throws made

Examples:

log.ftm #=> 20


108
# File 'lib/nba/team_game_log_entry.rb', line 108

attribute :ftm, Shale::Type::Integer

#game_dateString

Returns the game date

Examples:

log.game_date #=> "OCT 22, 2024"


28
# File 'lib/nba/team_game_log_entry.rb', line 28

attribute :game_date, Shale::Type::String

#game_idString

Returns the game ID

Examples:

log.game_id #=> "0022400001"


20
# File 'lib/nba/team_game_log_entry.rb', line 20

attribute :game_id, Shale::Type::String

#matchupString

Returns the matchup description

Examples:

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


36
# File 'lib/nba/team_game_log_entry.rb', line 36

attribute :matchup, Shale::Type::String

#minInteger

Returns the minutes played

Examples:

log.min #=> 240


52
# File 'lib/nba/team_game_log_entry.rb', line 52

attribute :min, Shale::Type::Integer

#orebInteger

Returns offensive rebounds

Examples:

log.oreb #=> 10


132
# File 'lib/nba/team_game_log_entry.rb', line 132

attribute :oreb, Shale::Type::Integer

#pfInteger

Returns personal fouls

Examples:

log.pf #=> 18


188
# File 'lib/nba/team_game_log_entry.rb', line 188

attribute :pf, Shale::Type::Integer

#plus_minusInteger

Returns plus/minus

Examples:

log.plus_minus #=> 12


204
# File 'lib/nba/team_game_log_entry.rb', line 204

attribute :plus_minus, Shale::Type::Integer

#ptsInteger

Returns points

Examples:

log.pts #=> 119


196
# File 'lib/nba/team_game_log_entry.rb', line 196

attribute :pts, Shale::Type::Integer

#rebInteger

Returns total rebounds

Examples:

log.reb #=> 45


148
# File 'lib/nba/team_game_log_entry.rb', line 148

attribute :reb, Shale::Type::Integer

#stlInteger

Returns steals

Examples:

log.stl #=> 8


164
# File 'lib/nba/team_game_log_entry.rb', line 164

attribute :stl, Shale::Type::Integer

#team_idInteger

Returns the team ID

Examples:

log.team_id #=> 1610612744


12
# File 'lib/nba/team_game_log_entry.rb', line 12

attribute :team_id, Shale::Type::Integer

#tovInteger

Returns turnovers

Examples:

log.tov #=> 12


180
# File 'lib/nba/team_game_log_entry.rb', line 180

attribute :tov, Shale::Type::Integer

#wlString

Returns the win/loss result

Examples:

log.wl #=> "W"


44
# File 'lib/nba/team_game_log_entry.rb', line 44

attribute :wl, Shale::Type::String

Instance Method Details

#gameGame?

Returns the game object for this log entry

Examples:

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


242
243
244
# File 'lib/nba/team_game_log_entry.rb', line 242

def game
  Games.find(game_id)
end

#loss?Boolean

Returns whether the game was a loss

Examples:

log.loss? #=> false


222
223
224
# File 'lib/nba/team_game_log_entry.rb', line 222

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

#teamTeam?

Returns the team object for this game log

Examples:

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


232
233
234
# File 'lib/nba/team_game_log_entry.rb', line 232

def team
  Teams.find(team_id)
end

#win?Boolean

Returns whether the game was a win

Examples:

log.win? #=> true


212
213
214
# File 'lib/nba/team_game_log_entry.rb', line 212

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