Class: NBA::BoxScorePlayerTrackStat

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

Overview

Represents player tracking statistics for a player in a game

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#astInteger

Returns assists

Examples:

stat.ast #=> 8

Returns:

  • (Integer)

    assists



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

attribute :ast, Shale::Type::Integer

#cfg_pctFloat

Returns contested field goal percentage

Examples:

stat.cfg_pct #=> 0.375

Returns:

  • (Float)

    contested field goal percentage



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

attribute :cfg_pct, Shale::Type::Float

#cfgaInteger

Returns contested field goals attempted

Examples:

stat.cfga #=> 8

Returns:

  • (Integer)

    contested field goals attempted



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

attribute :cfga, Shale::Type::Integer

#cfgmInteger

Returns contested field goals made

Examples:

stat.cfgm #=> 3

Returns:

  • (Integer)

    contested field goals made



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

attribute :cfgm, Shale::Type::Integer

#commentString

Returns any comment about the player

Examples:

stat.comment #=> "DNP - Rest"

Returns:

  • (String)

    the comment



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

attribute :comment, Shale::Type::String

#dfg_pctFloat

Returns defended field goal percentage

Examples:

stat.dfg_pct #=> 0.400

Returns:

  • (Float)

    defended field goal percentage



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

attribute :dfg_pct, Shale::Type::Float

#dfgaInteger

Returns defended field goals attempted

Examples:

stat.dfga #=> 10

Returns:

  • (Integer)

    defended field goals attempted



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

attribute :dfga, Shale::Type::Integer

#dfgmInteger

Returns defended field goals made

Examples:

stat.dfgm #=> 4

Returns:

  • (Integer)

    defended field goals made



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

attribute :dfgm, Shale::Type::Integer

#distanceFloat

Returns distance traveled in miles

Examples:

stat.distance #=> 2.67

Returns:

  • (Float)

    distance traveled



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

attribute :distance, Shale::Type::Float

#dreb_chancesInteger

Returns defensive rebound chances

Examples:

stat.dreb_chances #=> 12

Returns:

  • (Integer)

    defensive rebound chances



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

attribute :dreb_chances, Shale::Type::Integer

#ft_astInteger

Returns free throw assists

Examples:

stat.ft_ast #=> 1

Returns:

  • (Integer)

    free throw assists



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

attribute :ft_ast, Shale::Type::Integer

#game_idString

Returns the game ID

Examples:

stat.game_id #=> "0022400001"

Returns:

  • (String)

    the game ID



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

attribute :game_id, Shale::Type::String

#minString

Returns minutes played

Examples:

stat.min #=> "32:45"

Returns:

  • (String)

    the minutes



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

attribute :min, Shale::Type::String

#oreb_chancesInteger

Returns offensive rebound chances

Examples:

stat.oreb_chances #=> 5

Returns:

  • (Integer)

    offensive rebound chances



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

attribute :oreb_chances, Shale::Type::Integer

#passesInteger

Returns total passes

Examples:

stat.passes #=> 42

Returns:

  • (Integer)

    total passes



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

attribute :passes, Shale::Type::Integer

#player_idInteger

Returns the player ID

Examples:

stat.player_id #=> 201939

Returns:

  • (Integer)

    the player ID



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

attribute :player_id, Shale::Type::Integer

#player_nameString

Returns the player name

Examples:

stat.player_name #=> "Stephen Curry"

Returns:

  • (String)

    the player name



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

attribute :player_name, Shale::Type::String

#reb_chancesInteger

Returns total rebound chances

Examples:

stat.reb_chances #=> 17

Returns:

  • (Integer)

    total rebound chances



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

attribute :reb_chances, Shale::Type::Integer

#secondary_astInteger

Returns secondary assists

Examples:

stat.secondary_ast #=> 2

Returns:

  • (Integer)

    secondary assists



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

attribute :secondary_ast, Shale::Type::Integer

#speedFloat

Returns average speed in miles per hour

Examples:

stat.speed #=> 4.52

Returns:

  • (Float)

    average speed



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

attribute :speed, Shale::Type::Float

#start_positionString

Returns the starting position

Examples:

stat.start_position #=> "G"

Returns:

  • (String)

    the starting position



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

attribute :start_position, Shale::Type::String

#team_abbreviationString

Returns the team abbreviation

Examples:

stat.team_abbreviation #=> "GSW"

Returns:

  • (String)

    the team abbreviation



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

attribute :team_abbreviation, Shale::Type::String

#team_cityString

Returns the team city

Examples:

stat.team_city #=> "Golden State"

Returns:

  • (String)

    the team city



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

attribute :team_city, Shale::Type::String

#team_idInteger

Returns the team ID

Examples:

stat.team_id #=> 1610612744

Returns:

  • (Integer)

    the team ID



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

attribute :team_id, Shale::Type::Integer

#touchesInteger

Returns total touches

Examples:

stat.touches #=> 65

Returns:

  • (Integer)

    total touches



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

attribute :touches, Shale::Type::Integer

#ufg_pctFloat

Returns uncontested field goal percentage

Examples:

stat.ufg_pct #=> 0.833

Returns:

  • (Float)

    uncontested field goal percentage



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

attribute :ufg_pct, Shale::Type::Float

#ufgaInteger

Returns uncontested field goals attempted

Examples:

stat.ufga #=> 6

Returns:

  • (Integer)

    uncontested field goals attempted



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

attribute :ufga, Shale::Type::Integer

#ufgmInteger

Returns uncontested field goals made

Examples:

stat.ufgm #=> 5

Returns:

  • (Integer)

    uncontested field goals made



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

attribute :ufgm, Shale::Type::Integer

Instance Method Details

#gameGame?

Returns the game object

Examples:

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

Returns:

  • (Game, nil)

    the game object



259
260
261
# File 'lib/nba/box_score_player_track_stat.rb', line 259

def game
  Games.find(game_id)
end

#playerPlayer?

Returns the player object

Examples:

stat.player #=> #<NBA::Player>

Returns:

  • (Player, nil)

    the player object



239
240
241
# File 'lib/nba/box_score_player_track_stat.rb', line 239

def player
  Players.find(player_id)
end

#starter?Boolean

Returns whether the player started

Examples:

stat.starter? #=> true

Returns:

  • (Boolean)

    true if starter



269
270
271
# File 'lib/nba/box_score_player_track_stat.rb', line 269

def starter?
  !start_position.nil? && !start_position.empty?
end

#teamTeam?

Returns the team object

Examples:

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

Returns:

  • (Team, nil)

    the team object



249
250
251
# File 'lib/nba/box_score_player_track_stat.rb', line 249

def team
  Teams.find(team_id)
end