Class: NBA::BoxScoreMiscPlayerStat

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

Overview

Represents a player’s miscellaneous box score statistics for a game

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#blkInteger

Returns blocks

Examples:

stat.blk #=> 2


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

attribute :blk, Shale::Type::Integer

#blkaInteger

Returns blocked attempts

Examples:

stat.blka #=> 1


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

attribute :blka, Shale::Type::Integer

#commentString

Returns any comment (e.g., “DNP - Rest”)

Examples:

stat.comment #=> "DNP - Rest"


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

attribute :comment, Shale::Type::String

#game_idString

Returns the game ID

Examples:

stat.game_id #=> "0022400565"


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

attribute :game_id, Shale::Type::String

#minString

Returns minutes played

Examples:

stat.min #=> "35:24"


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

attribute :min, Shale::Type::String

#opp_pts_2nd_chanceInteger

Returns opponent second chance points

Examples:

stat.opp_pts_2nd_chance #=> 6


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

attribute :opp_pts_2nd_chance, Shale::Type::Integer

#opp_pts_fbInteger

Returns opponent fast break points

Examples:

stat.opp_pts_fb #=> 9


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

attribute :opp_pts_fb, Shale::Type::Integer

#opp_pts_off_tovInteger

Returns opponent points off turnovers

Examples:

stat.opp_pts_off_tov #=> 10


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

attribute :opp_pts_off_tov, Shale::Type::Integer

#opp_pts_paintInteger

Returns opponent points in the paint

Examples:

stat.opp_pts_paint #=> 38


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

attribute :opp_pts_paint, Shale::Type::Integer

#pfInteger

Returns personal fouls

Examples:

stat.pf #=> 3


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

attribute :pf, Shale::Type::Integer

#pfdInteger

Returns personal fouls drawn

Examples:

stat.pfd #=> 4


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

attribute :pfd, Shale::Type::Integer

#player_idInteger

Returns the player ID

Examples:

stat.player_id #=> 201939


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

attribute :player_id, Shale::Type::Integer

#player_nameString

Returns the player name

Examples:

stat.player_name #=> "Stephen Curry"


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

attribute :player_name, Shale::Type::String

#pts_2nd_chanceInteger

Returns second chance points

Examples:

stat.pts_2nd_chance #=> 8


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

attribute :pts_2nd_chance, Shale::Type::Integer

#pts_fbInteger

Returns fast break points

Examples:

stat.pts_fb #=> 15


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

attribute :pts_fb, Shale::Type::Integer

#pts_off_tovInteger

Returns points off turnovers

Examples:

stat.pts_off_tov #=> 12


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

attribute :pts_off_tov, Shale::Type::Integer

#pts_paintInteger

Returns points in the paint

Examples:

stat.pts_paint #=> 42


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

attribute :pts_paint, Shale::Type::Integer

#start_positionString

Returns the starting position

Examples:

stat.start_position #=> "G"


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

attribute :start_position, Shale::Type::String

#team_abbreviationString

Returns the team abbreviation

Examples:

stat.team_abbreviation #=> "GSW"


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

attribute :team_abbreviation, Shale::Type::String

#team_cityString

Returns the team city

Examples:

stat.team_city #=> "Golden State"


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

attribute :team_city, Shale::Type::String

#team_idInteger

Returns the team ID

Examples:

stat.team_id #=> 1610612744


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

attribute :team_id, Shale::Type::Integer

Instance Method Details

#gameGame?

Returns the game object for this box score

Examples:

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


213
214
215
# File 'lib/nba/box_score_misc_player_stat.rb', line 213

def game
  Games.find(game_id)
end

#playerPlayer?

Returns the player object

Examples:

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


183
184
185
# File 'lib/nba/box_score_misc_player_stat.rb', line 183

def player
  Players.find(player_id)
end

#starter?Boolean

Returns whether the player started the game

Examples:

stat.starter? #=> true


203
204
205
# File 'lib/nba/box_score_misc_player_stat.rb', line 203

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

#teamTeam?

Returns the team object

Examples:

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


193
194
195
# File 'lib/nba/box_score_misc_player_stat.rb', line 193

def team
  Teams.find(team_id)
end