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

Returns:

  • (Integer)

    blocks



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:

  • (Integer)

    blocked attempts



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:

  • (String)

    the comment



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:

  • (String)

    the game ID



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:

  • (String)

    the minutes played



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:

  • (Integer)

    opponent second chance points



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:

  • (Integer)

    opponent fast break points



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:

  • (Integer)

    opponent points off turnovers



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:

  • (Integer)

    opponent points in the paint



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:

  • (Integer)

    personal fouls



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:

  • (Integer)

    personal fouls drawn



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:

  • (Integer)

    the player ID



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:

  • (String)

    the player name



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:

  • (Integer)

    second chance points



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:

  • (Integer)

    fast break points



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:

  • (Integer)

    points off turnovers



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:

  • (Integer)

    points in the paint



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:

  • (String)

    the starting position



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:

  • (String)

    the team abbreviation



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:

  • (String)

    the team city



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:

  • (Integer)

    the team ID



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:

  • (Game, nil)

    the game object



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:

  • (Player, nil)

    the player object



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:

  • (Boolean)

    true if the player started



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:

  • (Team, nil)

    the team object



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

def team
  Teams.find(team_id)
end