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

API:

  • public

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#blkInteger

Returns blocks

Examples:

stat.blk #=> 2

Returns:

  • blocks

API:

  • public



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

Returns:

  • blocked attempts

API:

  • public



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"

Returns:

  • the comment

API:

  • public



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"

Returns:

  • the game ID

API:

  • public



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"

Returns:

  • the minutes played

API:

  • public



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

Returns:

  • opponent second chance points

API:

  • public



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

Returns:

  • opponent fast break points

API:

  • public



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

Returns:

  • opponent points off turnovers

API:

  • public



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

Returns:

  • opponent points in the paint

API:

  • public



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

Returns:

  • personal fouls

API:

  • public



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

Returns:

  • personal fouls drawn

API:

  • public



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

Returns:

  • the player ID

API:

  • public



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"

Returns:

  • the player name

API:

  • public



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

Returns:

  • second chance points

API:

  • public



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

Returns:

  • fast break points

API:

  • public



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

Returns:

  • points off turnovers

API:

  • public



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

Returns:

  • points in the paint

API:

  • public



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"

Returns:

  • the starting position

API:

  • public



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"

Returns:

  • the team abbreviation

API:

  • public



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"

Returns:

  • the team city

API:

  • public



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

Returns:

  • the team ID

API:

  • public



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>

Returns:

  • the game object

API:

  • public



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>

Returns:

  • the player object

API:

  • public



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

Returns:

  • true if the player started

API:

  • public



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>

Returns:

  • the team object

API:

  • public



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

def team
  Teams.find(team_id)
end