Class: NBA::PlayerDashboardStat

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

Overview

Represents player dashboard split statistics

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ast ⇒ Float

Returns assists per game

Examples:

stat.ast #=> 5.1

Returns:

  • (Float) —

    assists



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

attribute :ast, Shale::Type::Float

#blk ⇒ Float

Returns blocks per game

Examples:

stat.blk #=> 0.4

Returns:

  • (Float) —

    blocks



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

attribute :blk, Shale::Type::Float

#blka ⇒ Float

Returns blocked attempts per game

Examples:

stat.blka #=> 0.3

Returns:

  • (Float) —

    blocked attempts



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

attribute :blka, Shale::Type::Float

#dreb ⇒ Float

Returns defensive rebounds per game

Examples:

stat.dreb #=> 4.5

Returns:

  • (Float) —

    defensive rebounds



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

attribute :dreb, Shale::Type::Float

#fg3_pct ⇒ Float

Returns three-point percentage

Examples:

stat.fg3_pct #=> 0.408

Returns:

  • (Float) —

    three-point percentage



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

attribute :fg3_pct, Shale::Type::Float

#fg3a ⇒ Float

Returns three-pointers attempted per game

Examples:

stat.fg3a #=> 11.7

Returns:

  • (Float) —

    three-pointers attempted



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

attribute :fg3a, Shale::Type::Float

#fg3m ⇒ Float

Returns three-pointers made per game

Examples:

stat.fg3m #=> 4.8

Returns:

  • (Float) —

    three-pointers made



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

attribute :fg3m, Shale::Type::Float

#fg_pct ⇒ Float

Returns field goal percentage

Examples:

stat.fg_pct #=> 0.451

Returns:

  • (Float) —

    field goal percentage



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

attribute :fg_pct, Shale::Type::Float

#fga ⇒ Float

Returns field goals attempted per game

Examples:

stat.fga #=> 19.6

Returns:

  • (Float) —

    field goals attempted



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

attribute :fga, Shale::Type::Float

#fgm ⇒ Float

Returns field goals made per game

Examples:

stat.fgm #=> 10.0

Returns:

  • (Float) —

    field goals made



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

attribute :fgm, Shale::Type::Float

#ft_pct ⇒ Float

Returns free throw percentage

Examples:

stat.ft_pct #=> 0.921

Returns:

  • (Float) —

    free throw percentage



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

attribute :ft_pct, Shale::Type::Float

#fta ⇒ Float

Returns free throws attempted per game

Examples:

stat.fta #=> 5.1

Returns:

  • (Float) —

    free throws attempted



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

attribute :fta, Shale::Type::Float

#ftm ⇒ Float

Returns free throws made per game

Examples:

stat.ftm #=> 4.8

Returns:

  • (Float) —

    free throws made



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

attribute :ftm, Shale::Type::Float

#gp ⇒ Integer

Returns games played

Examples:

stat.gp #=> 74

Returns:

  • (Integer) —

    games played



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

attribute :gp, Shale::Type::Integer

#group_set ⇒ String

Returns the group set name

Examples:

stat.group_set #=> "Overall"

Returns:

  • (String) —

    the group set



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

attribute :group_set, Shale::Type::String

#group_value ⇒ String

Returns the group value

Examples:

stat.group_value #=> "2023-24"

Returns:

  • (String) —

    the group value



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

attribute :group_value, Shale::Type::String

#l ⇒ Integer

Returns losses

Examples:

stat.l #=> 28

Returns:

  • (Integer) —

    losses



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

attribute :l, Shale::Type::Integer

#min ⇒ Float

Returns minutes per game

Examples:

stat.min #=> 32.7

Returns:

  • (Float) —

    minutes



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

attribute :min, Shale::Type::Float

#oreb ⇒ Float

Returns offensive rebounds per game

Examples:

stat.oreb #=> 0.7

Returns:

  • (Float) —

    offensive rebounds



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

attribute :oreb, Shale::Type::Float

#pf ⇒ Float

Returns personal fouls per game

Examples:

stat.pf #=> 1.6

Returns:

  • (Float) —

    personal fouls



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

attribute :pf, Shale::Type::Float

#pfd ⇒ Float

Returns personal fouls drawn per game

Examples:

stat.pfd #=> 1.9

Returns:

  • (Float) —

    personal fouls drawn



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

attribute :pfd, Shale::Type::Float

#player_id ⇒ Integer

Returns the player ID

Examples:

stat.player_id #=> 201939

Returns:

  • (Integer) —

    the player ID



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

attribute :player_id, Shale::Type::Integer

#plus_minus ⇒ Float

Returns plus/minus per game

Examples:

stat.plus_minus #=> 7.8

Returns:

  • (Float) —

    plus/minus



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

attribute :plus_minus, Shale::Type::Float

#pts ⇒ Float

Returns points per game

Examples:

stat.pts #=> 26.4

Returns:

  • (Float) —

    points



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

attribute :pts, Shale::Type::Float

#reb ⇒ Float

Returns total rebounds per game

Examples:

stat.reb #=> 5.1

Returns:

  • (Float) —

    total rebounds



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

attribute :reb, Shale::Type::Float

#stl ⇒ Float

Returns steals per game

Examples:

stat.stl #=> 0.7

Returns:

  • (Float) —

    steals



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

attribute :stl, Shale::Type::Float

#tov ⇒ Float

Returns turnovers per game

Examples:

stat.tov #=> 2.8

Returns:

  • (Float) —

    turnovers



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

attribute :tov, Shale::Type::Float

#w ⇒ Integer

Returns wins

Examples:

stat.w #=> 46

Returns:

  • (Integer) —

    wins



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

attribute :w, Shale::Type::Integer

#w_pct ⇒ Float

Returns win percentage

Examples:

stat.w_pct #=> 0.622

Returns:

  • (Float) —

    win percentage



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

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



244
245
246
# File 'lib/nba/player_dashboard_stat.rb', line 244

def player
  Players.find(player_id)
end