Class: NBA::LeagueDashPlayerStat

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

Overview

Represents a player’s league dashboard statistics

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ageInteger

Returns the player’s age

Examples:

stat.age #=> 36


44
# File 'lib/nba/league_dash_player_stat.rb', line 44

attribute :age, Shale::Type::Integer

#astFloat

Returns assists per game

Examples:

stat.ast #=> 6.3


188
# File 'lib/nba/league_dash_player_stat.rb', line 188

attribute :ast, Shale::Type::Float

#blkFloat

Returns blocks per game

Examples:

stat.blk #=> 0.4


212
# File 'lib/nba/league_dash_player_stat.rb', line 212

attribute :blk, Shale::Type::Float

#blkaFloat

Returns blocked attempts per game

Examples:

stat.blka #=> 0.2


220
# File 'lib/nba/league_dash_player_stat.rb', line 220

attribute :blka, Shale::Type::Float

#dd2Integer

Returns double-doubles

Examples:

stat.dd2 #=> 15


268
# File 'lib/nba/league_dash_player_stat.rb', line 268

attribute :dd2, Shale::Type::Integer

#drebFloat

Returns defensive rebounds per game

Examples:

stat.dreb #=> 4.9


172
# File 'lib/nba/league_dash_player_stat.rb', line 172

attribute :dreb, Shale::Type::Float

#fg3_pctFloat

Returns three-point percentage

Examples:

stat.fg3_pct #=> 0.410


132
# File 'lib/nba/league_dash_player_stat.rb', line 132

attribute :fg3_pct, Shale::Type::Float

#fg3aFloat

Returns three-pointers attempted per game

Examples:

stat.fg3a #=> 11.7


124
# File 'lib/nba/league_dash_player_stat.rb', line 124

attribute :fg3a, Shale::Type::Float

#fg3mFloat

Returns three-pointers made per game

Examples:

stat.fg3m #=> 4.8


116
# File 'lib/nba/league_dash_player_stat.rb', line 116

attribute :fg3m, Shale::Type::Float

#fg_pctFloat

Returns field goal percentage

Examples:

stat.fg_pct #=> 0.474


108
# File 'lib/nba/league_dash_player_stat.rb', line 108

attribute :fg_pct, Shale::Type::Float

#fgaFloat

Returns field goals attempted per game

Examples:

stat.fga #=> 19.4


100
# File 'lib/nba/league_dash_player_stat.rb', line 100

attribute :fga, Shale::Type::Float

#fgmFloat

Returns field goals made per game

Examples:

stat.fgm #=> 9.2


92
# File 'lib/nba/league_dash_player_stat.rb', line 92

attribute :fgm, Shale::Type::Float

#ft_pctFloat

Returns free throw percentage

Examples:

stat.ft_pct #=> 0.911


156
# File 'lib/nba/league_dash_player_stat.rb', line 156

attribute :ft_pct, Shale::Type::Float

#ftaFloat

Returns free throws attempted per game

Examples:

stat.fta #=> 5.6


148
# File 'lib/nba/league_dash_player_stat.rb', line 148

attribute :fta, Shale::Type::Float

#ftmFloat

Returns free throws made per game

Examples:

stat.ftm #=> 5.1


140
# File 'lib/nba/league_dash_player_stat.rb', line 140

attribute :ftm, Shale::Type::Float

#gpInteger

Returns games played

Examples:

stat.gp #=> 72


52
# File 'lib/nba/league_dash_player_stat.rb', line 52

attribute :gp, Shale::Type::Integer

#lInteger

Returns losses

Examples:

stat.l #=> 26


68
# File 'lib/nba/league_dash_player_stat.rb', line 68

attribute :l, Shale::Type::Integer

#minFloat

Returns minutes per game

Examples:

stat.min #=> 34.7


84
# File 'lib/nba/league_dash_player_stat.rb', line 84

attribute :min, Shale::Type::Float

#nba_fantasy_ptsFloat

Returns fantasy points per game

Examples:

stat.nba_fantasy_pts #=> 52.3


260
# File 'lib/nba/league_dash_player_stat.rb', line 260

attribute :nba_fantasy_pts, Shale::Type::Float

#orebFloat

Returns offensive rebounds per game

Examples:

stat.oreb #=> 0.7


164
# File 'lib/nba/league_dash_player_stat.rb', line 164

attribute :oreb, Shale::Type::Float

#pfFloat

Returns personal fouls per game

Examples:

stat.pf #=> 1.8


228
# File 'lib/nba/league_dash_player_stat.rb', line 228

attribute :pf, Shale::Type::Float

#pfdFloat

Returns personal fouls drawn per game

Examples:

stat.pfd #=> 2.7


236
# File 'lib/nba/league_dash_player_stat.rb', line 236

attribute :pfd, Shale::Type::Float

#player_idInteger

Returns the player ID

Examples:

stat.player_id #=> 201939


12
# File 'lib/nba/league_dash_player_stat.rb', line 12

attribute :player_id, Shale::Type::Integer

#player_nameString

Returns the player name

Examples:

stat.player_name #=> "Stephen Curry"


20
# File 'lib/nba/league_dash_player_stat.rb', line 20

attribute :player_name, Shale::Type::String

#plus_minusFloat

Returns plus/minus per game

Examples:

stat.plus_minus #=> 7.1


252
# File 'lib/nba/league_dash_player_stat.rb', line 252

attribute :plus_minus, Shale::Type::Float

#ptsFloat

Returns points per game

Examples:

stat.pts #=> 28.4


244
# File 'lib/nba/league_dash_player_stat.rb', line 244

attribute :pts, Shale::Type::Float

#rebFloat

Returns total rebounds per game

Examples:

stat.reb #=> 5.6


180
# File 'lib/nba/league_dash_player_stat.rb', line 180

attribute :reb, Shale::Type::Float

#season_idString

Returns the season ID

Examples:

stat.season_id #=> "2024-25"


284
# File 'lib/nba/league_dash_player_stat.rb', line 284

attribute :season_id, Shale::Type::String

#stlFloat

Returns steals per game

Examples:

stat.stl #=> 1.3


204
# File 'lib/nba/league_dash_player_stat.rb', line 204

attribute :stl, Shale::Type::Float

#td3Integer

Returns triple-doubles

Examples:

stat.td3 #=> 3


276
# File 'lib/nba/league_dash_player_stat.rb', line 276

attribute :td3, Shale::Type::Integer

#team_abbreviationString

Returns the team abbreviation

Examples:

stat.team_abbreviation #=> "GSW"


36
# File 'lib/nba/league_dash_player_stat.rb', line 36

attribute :team_abbreviation, Shale::Type::String

#team_idInteger

Returns the team ID

Examples:

stat.team_id #=> 1610612744


28
# File 'lib/nba/league_dash_player_stat.rb', line 28

attribute :team_id, Shale::Type::Integer

#tovFloat

Returns turnovers per game

Examples:

stat.tov #=> 2.8


196
# File 'lib/nba/league_dash_player_stat.rb', line 196

attribute :tov, Shale::Type::Float

#wInteger

Returns wins

Examples:

stat.w #=> 46


60
# File 'lib/nba/league_dash_player_stat.rb', line 60

attribute :w, Shale::Type::Integer

#w_pctFloat

Returns win percentage

Examples:

stat.w_pct #=> 0.639


76
# File 'lib/nba/league_dash_player_stat.rb', line 76

attribute :w_pct, Shale::Type::Float

Instance Method Details

#playerPlayer?

Returns the player object

Examples:

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


292
293
294
# File 'lib/nba/league_dash_player_stat.rb', line 292

def player
  Players.find(player_id)
end

#teamTeam?

Returns the team object

Examples:

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


302
303
304
# File 'lib/nba/league_dash_player_stat.rb', line 302

def team
  Teams.find(team_id)
end