Class: NBA::BoxScorePlayerStat
- Inherits:
-
Shale::Mapper
- Object
- Shale::Mapper
- NBA::BoxScorePlayerStat
- Defined in:
- lib/nba/box_score_player_stat.rb
Overview
Represents a player’s box score statistics for a game
Instance Attribute Summary collapse
-
#ast ⇒ Integer
Returns assists.
-
#blk ⇒ Integer
Returns blocks.
-
#comment ⇒ String
Returns any comment (e.g., “DNP - Rest”).
-
#dreb ⇒ Integer
Returns defensive rebounds.
-
#fg3_pct ⇒ Float
Returns three-point percentage.
-
#fg3a ⇒ Integer
Returns three-pointers attempted.
-
#fg3m ⇒ Integer
Returns three-pointers made.
-
#fg_pct ⇒ Float
Returns field goal percentage.
-
#fga ⇒ Integer
Returns field goals attempted.
-
#fgm ⇒ Integer
Returns field goals made.
-
#ft_pct ⇒ Float
Returns free throw percentage.
-
#fta ⇒ Integer
Returns free throws attempted.
-
#ftm ⇒ Integer
Returns free throws made.
-
#game_id ⇒ String
Returns the game ID.
-
#min ⇒ String
Returns minutes played.
-
#oreb ⇒ Integer
Returns offensive rebounds.
-
#pf ⇒ Integer
Returns personal fouls.
-
#player_id ⇒ Integer
Returns the player ID.
-
#player_name ⇒ String
Returns the player name.
-
#plus_minus ⇒ Integer
Returns plus/minus.
-
#pts ⇒ Integer
Returns points.
-
#reb ⇒ Integer
Returns total rebounds.
-
#start_position ⇒ String
Returns the starting position.
-
#stl ⇒ Integer
Returns steals.
-
#team_abbreviation ⇒ String
Returns the team abbreviation.
-
#team_city ⇒ String
Returns the team city.
-
#team_id ⇒ Integer
Returns the team ID.
-
#tov ⇒ Integer
Returns turnovers.
Instance Method Summary collapse
-
#game ⇒ Game?
Returns the game object for this box score.
-
#player ⇒ Player?
Returns the player object.
-
#starter? ⇒ Boolean
Returns whether the player started the game.
-
#team ⇒ Team?
Returns the team object.
Instance Attribute Details
#ast ⇒ Integer
Returns assists
183 |
# File 'lib/nba/box_score_player_stat.rb', line 183 attribute :ast, Shale::Type::Integer |
#blk ⇒ Integer
Returns blocks
199 |
# File 'lib/nba/box_score_player_stat.rb', line 199 attribute :blk, Shale::Type::Integer |
#comment ⇒ String
Returns any comment (e.g., “DNP - Rest”)
71 |
# File 'lib/nba/box_score_player_stat.rb', line 71 attribute :comment, Shale::Type::String |
#dreb ⇒ Integer
Returns defensive rebounds
167 |
# File 'lib/nba/box_score_player_stat.rb', line 167 attribute :dreb, Shale::Type::Integer |
#fg3_pct ⇒ Float
Returns three-point percentage
127 |
# File 'lib/nba/box_score_player_stat.rb', line 127 attribute :fg3_pct, Shale::Type::Float |
#fg3a ⇒ Integer
Returns three-pointers attempted
119 |
# File 'lib/nba/box_score_player_stat.rb', line 119 attribute :fg3a, Shale::Type::Integer |
#fg3m ⇒ Integer
Returns three-pointers made
111 |
# File 'lib/nba/box_score_player_stat.rb', line 111 attribute :fg3m, Shale::Type::Integer |
#fg_pct ⇒ Float
Returns field goal percentage
103 |
# File 'lib/nba/box_score_player_stat.rb', line 103 attribute :fg_pct, Shale::Type::Float |
#fga ⇒ Integer
Returns field goals attempted
95 |
# File 'lib/nba/box_score_player_stat.rb', line 95 attribute :fga, Shale::Type::Integer |
#fgm ⇒ Integer
Returns field goals made
87 |
# File 'lib/nba/box_score_player_stat.rb', line 87 attribute :fgm, Shale::Type::Integer |
#ft_pct ⇒ Float
Returns free throw percentage
151 |
# File 'lib/nba/box_score_player_stat.rb', line 151 attribute :ft_pct, Shale::Type::Float |
#fta ⇒ Integer
Returns free throws attempted
143 |
# File 'lib/nba/box_score_player_stat.rb', line 143 attribute :fta, Shale::Type::Integer |
#ftm ⇒ Integer
Returns free throws made
135 |
# File 'lib/nba/box_score_player_stat.rb', line 135 attribute :ftm, Shale::Type::Integer |
#game_id ⇒ String
Returns the game ID
15 |
# File 'lib/nba/box_score_player_stat.rb', line 15 attribute :game_id, Shale::Type::String |
#min ⇒ String
Returns minutes played
79 |
# File 'lib/nba/box_score_player_stat.rb', line 79 attribute :min, Shale::Type::String |
#oreb ⇒ Integer
Returns offensive rebounds
159 |
# File 'lib/nba/box_score_player_stat.rb', line 159 attribute :oreb, Shale::Type::Integer |
#pf ⇒ Integer
Returns personal fouls
215 |
# File 'lib/nba/box_score_player_stat.rb', line 215 attribute :pf, Shale::Type::Integer |
#player_id ⇒ Integer
Returns the player ID
47 |
# File 'lib/nba/box_score_player_stat.rb', line 47 attribute :player_id, Shale::Type::Integer |
#player_name ⇒ String
Returns the player name
55 |
# File 'lib/nba/box_score_player_stat.rb', line 55 attribute :player_name, Shale::Type::String |
#plus_minus ⇒ Integer
Returns plus/minus
231 |
# File 'lib/nba/box_score_player_stat.rb', line 231 attribute :plus_minus, Shale::Type::Integer |
#pts ⇒ Integer
Returns points
223 |
# File 'lib/nba/box_score_player_stat.rb', line 223 attribute :pts, Shale::Type::Integer |
#reb ⇒ Integer
Returns total rebounds
175 |
# File 'lib/nba/box_score_player_stat.rb', line 175 attribute :reb, Shale::Type::Integer |
#start_position ⇒ String
Returns the starting position
63 |
# File 'lib/nba/box_score_player_stat.rb', line 63 attribute :start_position, Shale::Type::String |
#stl ⇒ Integer
Returns steals
191 |
# File 'lib/nba/box_score_player_stat.rb', line 191 attribute :stl, Shale::Type::Integer |
#team_abbreviation ⇒ String
Returns the team abbreviation
31 |
# File 'lib/nba/box_score_player_stat.rb', line 31 attribute :team_abbreviation, Shale::Type::String |
#team_city ⇒ String
Returns the team city
39 |
# File 'lib/nba/box_score_player_stat.rb', line 39 attribute :team_city, Shale::Type::String |
#team_id ⇒ Integer
Returns the team ID
23 |
# File 'lib/nba/box_score_player_stat.rb', line 23 attribute :team_id, Shale::Type::Integer |
#tov ⇒ Integer
Returns turnovers
207 |
# File 'lib/nba/box_score_player_stat.rb', line 207 attribute :tov, Shale::Type::Integer |
Instance Method Details
#game ⇒ Game?
Returns the game object for this box score
269 270 271 |
# File 'lib/nba/box_score_player_stat.rb', line 269 def game Games.find(game_id) end |
#player ⇒ Player?
Returns the player object
239 240 241 |
# File 'lib/nba/box_score_player_stat.rb', line 239 def player Players.find(player_id) end |
#starter? ⇒ Boolean
Returns whether the player started the game
259 260 261 |
# File 'lib/nba/box_score_player_stat.rb', line 259 def starter? !start_position.nil? && !start_position.empty? end |