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

#age ⇒ Integer

Returns the player's age

Examples:

stat.age #=> 36

Returns:

  • (Integer) —

    the age



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

attribute :age, Shale::Type::Integer

#ast ⇒ Float

Returns assists per game

Examples:

stat.ast #=> 6.3

Returns:

  • (Float) —

    assists



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

attribute :ast, Shale::Type::Float

#blk ⇒ Float

Returns blocks per game

Examples:

stat.blk #=> 0.4

Returns:

  • (Float) —

    blocks



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

attribute :blk, Shale::Type::Float

#blka ⇒ Float

Returns blocked attempts per game

Examples:

stat.blka #=> 0.2

Returns:

  • (Float) —

    blocked attempts



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

attribute :blka, Shale::Type::Float

#dd2 ⇒ Integer

Returns double-doubles

Examples:

stat.dd2 #=> 15

Returns:

  • (Integer) —

    double-doubles



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

attribute :dd2, Shale::Type::Integer

#dreb ⇒ Float

Returns defensive rebounds per game

Examples:

stat.dreb #=> 4.9

Returns:

  • (Float) —

    defensive rebounds



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

attribute :dreb, Shale::Type::Float

#fg3_pct ⇒ Float

Returns three-point percentage

Examples:

stat.fg3_pct #=> 0.410

Returns:

  • (Float) —

    three-point percentage



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

attribute :fg3_pct, Shale::Type::Float

#fg3a ⇒ Float

Returns three-pointers attempted per game

Examples:

stat.fg3a #=> 11.7

Returns:

  • (Float) —

    three-pointers attempted



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

attribute :fg3a, Shale::Type::Float

#fg3m ⇒ Float

Returns three-pointers made per game

Examples:

stat.fg3m #=> 4.8

Returns:

  • (Float) —

    three-pointers made



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

attribute :fg3m, Shale::Type::Float

#fg_pct ⇒ Float

Returns field goal percentage

Examples:

stat.fg_pct #=> 0.474

Returns:

  • (Float) —

    field goal percentage



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

attribute :fg_pct, Shale::Type::Float

#fga ⇒ Float

Returns field goals attempted per game

Examples:

stat.fga #=> 19.4

Returns:

  • (Float) —

    field goals attempted



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

attribute :fga, Shale::Type::Float

#fgm ⇒ Float

Returns field goals made per game

Examples:

stat.fgm #=> 9.2

Returns:

  • (Float) —

    field goals made



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

attribute :fgm, Shale::Type::Float

#ft_pct ⇒ Float

Returns free throw percentage

Examples:

stat.ft_pct #=> 0.911

Returns:

  • (Float) —

    free throw percentage



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

attribute :ft_pct, Shale::Type::Float

#fta ⇒ Float

Returns free throws attempted per game

Examples:

stat.fta #=> 5.6

Returns:

  • (Float) —

    free throws attempted



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

attribute :fta, Shale::Type::Float

#ftm ⇒ Float

Returns free throws made per game

Examples:

stat.ftm #=> 5.1

Returns:

  • (Float) —

    free throws made



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

attribute :ftm, Shale::Type::Float

#gp ⇒ Integer

Returns games played

Examples:

stat.gp #=> 72

Returns:

  • (Integer) —

    games played



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

attribute :gp, Shale::Type::Integer

#l ⇒ Integer

Returns losses

Examples:

stat.l #=> 26

Returns:

  • (Integer) —

    losses



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

attribute :l, Shale::Type::Integer

#min ⇒ Float

Returns minutes per game

Examples:

stat.min #=> 34.7

Returns:

  • (Float) —

    minutes per game



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

attribute :min, Shale::Type::Float

#nba_fantasy_pts ⇒ Float

Returns fantasy points per game

Examples:

stat.nba_fantasy_pts #=> 52.3

Returns:

  • (Float) —

    fantasy points



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

attribute :nba_fantasy_pts, Shale::Type::Float

#oreb ⇒ Float

Returns offensive rebounds per game

Examples:

stat.oreb #=> 0.7

Returns:

  • (Float) —

    offensive rebounds



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

attribute :oreb, Shale::Type::Float

#pf ⇒ Float

Returns personal fouls per game

Examples:

stat.pf #=> 1.8

Returns:

  • (Float) —

    personal fouls



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

attribute :pf, Shale::Type::Float

#pfd ⇒ Float

Returns personal fouls drawn per game

Examples:

stat.pfd #=> 2.7

Returns:

  • (Float) —

    personal fouls drawn



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

attribute :pfd, Shale::Type::Float

#player_id ⇒ Integer

Returns the player ID

Examples:

stat.player_id #=> 201939

Returns:

  • (Integer) —

    the player ID



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

attribute :player_id, Shale::Type::Integer

#player_name ⇒ String

Returns the player name

Examples:

stat.player_name #=> "Stephen Curry"

Returns:

  • (String) —

    the player name



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

attribute :player_name, Shale::Type::String

#plus_minus ⇒ Float

Returns plus/minus per game

Examples:

stat.plus_minus #=> 7.1

Returns:

  • (Float) —

    plus/minus



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

attribute :plus_minus, Shale::Type::Float

#pts ⇒ Float

Returns points per game

Examples:

stat.pts #=> 28.4

Returns:

  • (Float) —

    points



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

attribute :pts, Shale::Type::Float

#reb ⇒ Float

Returns total rebounds per game

Examples:

stat.reb #=> 5.6

Returns:

  • (Float) —

    total rebounds



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

attribute :reb, Shale::Type::Float

#season_id ⇒ String

Returns the season ID

Examples:

stat.season_id #=> "2024-25"

Returns:

  • (String) —

    the season ID



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

attribute :season_id, Shale::Type::String

#stl ⇒ Float

Returns steals per game

Examples:

stat.stl #=> 1.3

Returns:

  • (Float) —

    steals



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

attribute :stl, Shale::Type::Float

#td3 ⇒ Integer

Returns triple-doubles

Examples:

stat.td3 #=> 3

Returns:

  • (Integer) —

    triple-doubles



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

attribute :td3, Shale::Type::Integer

#team_abbreviation ⇒ String

Returns the team abbreviation

Examples:

stat.team_abbreviation #=> "GSW"

Returns:

  • (String) —

    the team abbreviation



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

attribute :team_abbreviation, Shale::Type::String

#team_id ⇒ Integer

Returns the team ID

Examples:

stat.team_id #=> 1610612744

Returns:

  • (Integer) —

    the team ID



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

attribute :team_id, Shale::Type::Integer

#tov ⇒ Float

Returns turnovers per game

Examples:

stat.tov #=> 2.8

Returns:

  • (Float) —

    turnovers



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

attribute :tov, Shale::Type::Float

#w ⇒ Integer

Returns wins

Examples:

stat.w #=> 46

Returns:

  • (Integer) —

    wins



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

attribute :w, Shale::Type::Integer

#w_pct ⇒ Float

Returns win percentage

Examples:

stat.w_pct #=> 0.639

Returns:

  • (Float) —

    win percentage



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

attribute :w_pct, Shale::Type::Float

Instance Method Details

#player ⇒ Player?

Returns the player object

Examples:

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

Returns:

  • (Player, nil) —

    the player object



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

def player
  Players.find(player_id)
end

#team ⇒ Team?

Returns the team object

Examples:

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

Returns:

  • (Team, nil) —

    the team object



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

def team
  Teams.find(team_id)
end