Class: NBA::LeaguePlayerOnDetailsStat

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

Overview

Represents league-wide player on/off court statistics

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ast ⇒ Float

Returns assists

Examples:

stat.ast #=> 6.3

Returns:

  • (Float) —

    assists



207
# File 'lib/nba/league_player_on_details_stat.rb', line 207

attribute :ast, Shale::Type::Float

#blk ⇒ Float

Returns blocks

Examples:

stat.blk #=> 0.4

Returns:

  • (Float) —

    blocks



231
# File 'lib/nba/league_player_on_details_stat.rb', line 231

attribute :blk, Shale::Type::Float

#blka ⇒ Float

Returns blocked attempts

Examples:

stat.blka #=> 0.3

Returns:

  • (Float) —

    blocked attempts



239
# File 'lib/nba/league_player_on_details_stat.rb', line 239

attribute :blka, Shale::Type::Float

#court_status ⇒ String

Returns the court status (On or Off)

Examples:

stat.court_status #=> "On"

Returns:

  • (String) —

    the court status



63
# File 'lib/nba/league_player_on_details_stat.rb', line 63

attribute :court_status, Shale::Type::String

#dreb ⇒ Float

Returns defensive rebounds

Examples:

stat.dreb #=> 5.4

Returns:

  • (Float) —

    defensive rebounds



191
# File 'lib/nba/league_player_on_details_stat.rb', line 191

attribute :dreb, Shale::Type::Float

#fg3_pct ⇒ Float

Returns three point percentage

Examples:

stat.fg3_pct #=> 0.411

Returns:

  • (Float) —

    three point percentage



151
# File 'lib/nba/league_player_on_details_stat.rb', line 151

attribute :fg3_pct, Shale::Type::Float

#fg3a ⇒ Float

Returns three pointers attempted

Examples:

stat.fg3a #=> 11.7

Returns:

  • (Float) —

    three pointers attempted



143
# File 'lib/nba/league_player_on_details_stat.rb', line 143

attribute :fg3a, Shale::Type::Float

#fg3m ⇒ Float

Returns three pointers made

Examples:

stat.fg3m #=> 4.8

Returns:

  • (Float) —

    three pointers made



135
# File 'lib/nba/league_player_on_details_stat.rb', line 135

attribute :fg3m, Shale::Type::Float

#fg_pct ⇒ Float

Returns field goal percentage

Examples:

stat.fg_pct #=> 0.485

Returns:

  • (Float) —

    field goal percentage



127
# File 'lib/nba/league_player_on_details_stat.rb', line 127

attribute :fg_pct, Shale::Type::Float

#fga ⇒ Float

Returns field goals attempted

Examples:

stat.fga #=> 20.2

Returns:

  • (Float) —

    field goals attempted



119
# File 'lib/nba/league_player_on_details_stat.rb', line 119

attribute :fga, Shale::Type::Float

#fgm ⇒ Float

Returns field goals made

Examples:

stat.fgm #=> 9.8

Returns:

  • (Float) —

    field goals made



111
# File 'lib/nba/league_player_on_details_stat.rb', line 111

attribute :fgm, Shale::Type::Float

#ft_pct ⇒ Float

Returns free throw percentage

Examples:

stat.ft_pct #=> 0.913

Returns:

  • (Float) —

    free throw percentage



175
# File 'lib/nba/league_player_on_details_stat.rb', line 175

attribute :ft_pct, Shale::Type::Float

#fta ⇒ Float

Returns free throws attempted

Examples:

stat.fta #=> 4.6

Returns:

  • (Float) —

    free throws attempted



167
# File 'lib/nba/league_player_on_details_stat.rb', line 167

attribute :fta, Shale::Type::Float

#ftm ⇒ Float

Returns free throws made

Examples:

stat.ftm #=> 4.2

Returns:

  • (Float) —

    free throws made



159
# File 'lib/nba/league_player_on_details_stat.rb', line 159

attribute :ftm, Shale::Type::Float

#gp ⇒ Integer

Returns games played

Examples:

stat.gp #=> 74

Returns:

  • (Integer) —

    games played



71
# File 'lib/nba/league_player_on_details_stat.rb', line 71

attribute :gp, Shale::Type::Integer

#group_set ⇒ String

Returns the group set

Examples:

stat.group_set #=> "Overall"

Returns:

  • (String) —

    the group set



15
# File 'lib/nba/league_player_on_details_stat.rb', line 15

attribute :group_set, Shale::Type::String

#l ⇒ Integer

Returns losses

Examples:

stat.l #=> 28

Returns:

  • (Integer) —

    losses



87
# File 'lib/nba/league_player_on_details_stat.rb', line 87

attribute :l, Shale::Type::Integer

#min ⇒ Float

Returns minutes

Examples:

stat.min #=> 32.5

Returns:

  • (Float) —

    minutes



103
# File 'lib/nba/league_player_on_details_stat.rb', line 103

attribute :min, Shale::Type::Float

#oreb ⇒ Float

Returns offensive rebounds

Examples:

stat.oreb #=> 0.7

Returns:

  • (Float) —

    offensive rebounds



183
# File 'lib/nba/league_player_on_details_stat.rb', line 183

attribute :oreb, Shale::Type::Float

#pf ⇒ Float

Returns personal fouls

Examples:

stat.pf #=> 2.0

Returns:

  • (Float) —

    personal fouls



247
# File 'lib/nba/league_player_on_details_stat.rb', line 247

attribute :pf, Shale::Type::Float

#pfd ⇒ Float

Returns personal fouls drawn

Examples:

stat.pfd #=> 3.8

Returns:

  • (Float) —

    personal fouls drawn



255
# File 'lib/nba/league_player_on_details_stat.rb', line 255

attribute :pfd, Shale::Type::Float

#plus_minus ⇒ Float

Returns plus/minus

Examples:

stat.plus_minus #=> 7.4

Returns:

  • (Float) —

    plus/minus



271
# File 'lib/nba/league_player_on_details_stat.rb', line 271

attribute :plus_minus, Shale::Type::Float

#pts ⇒ Float

Returns points

Examples:

stat.pts #=> 28.6

Returns:

  • (Float) —

    points



263
# File 'lib/nba/league_player_on_details_stat.rb', line 263

attribute :pts, Shale::Type::Float

#reb ⇒ Float

Returns total rebounds

Examples:

stat.reb #=> 6.1

Returns:

  • (Float) —

    total rebounds



199
# File 'lib/nba/league_player_on_details_stat.rb', line 199

attribute :reb, Shale::Type::Float

#stl ⇒ Float

Returns steals

Examples:

stat.stl #=> 0.9

Returns:

  • (Float) —

    steals



223
# File 'lib/nba/league_player_on_details_stat.rb', line 223

attribute :stl, Shale::Type::Float

#team_abbreviation ⇒ String

Returns the team abbreviation

Examples:

stat.team_abbreviation #=> "GSW"

Returns:

  • (String) —

    the team abbreviation



31
# File 'lib/nba/league_player_on_details_stat.rb', line 31

attribute :team_abbreviation, Shale::Type::String

#team_id ⇒ Integer

Returns the team ID

Examples:

stat.team_id #=> 1610612744

Returns:

  • (Integer) —

    the team ID



23
# File 'lib/nba/league_player_on_details_stat.rb', line 23

attribute :team_id, Shale::Type::Integer

#team_name ⇒ String

Returns the team name

Examples:

stat.team_name #=> "Golden State Warriors"

Returns:

  • (String) —

    the team name



39
# File 'lib/nba/league_player_on_details_stat.rb', line 39

attribute :team_name, Shale::Type::String

#tov ⇒ Float

Returns turnovers

Examples:

stat.tov #=> 3.2

Returns:

  • (Float) —

    turnovers



215
# File 'lib/nba/league_player_on_details_stat.rb', line 215

attribute :tov, Shale::Type::Float

#vs_player_id ⇒ Integer

Returns the player ID

Examples:

stat.vs_player_id #=> 201939

Returns:

  • (Integer) —

    the player ID



47
# File 'lib/nba/league_player_on_details_stat.rb', line 47

attribute :vs_player_id, Shale::Type::Integer

#vs_player_name ⇒ String

Returns the player name

Examples:

stat.vs_player_name #=> "Stephen Curry"

Returns:

  • (String) —

    the player name



55
# File 'lib/nba/league_player_on_details_stat.rb', line 55

attribute :vs_player_name, Shale::Type::String

#w ⇒ Integer

Returns wins

Examples:

stat.w #=> 46

Returns:

  • (Integer) —

    wins



79
# File 'lib/nba/league_player_on_details_stat.rb', line 79

attribute :w, Shale::Type::Integer

#w_pct ⇒ Float

Returns win percentage

Examples:

stat.w_pct #=> 0.622

Returns:

  • (Float) —

    win percentage



95
# File 'lib/nba/league_player_on_details_stat.rb', line 95

attribute :w_pct, Shale::Type::Float

Instance Method Details

#off_court? ⇒ Boolean

Returns whether the player is off court

Examples:

stat.off_court? #=> true

Returns:

  • (Boolean) —

    true if player is off court



309
310
311
# File 'lib/nba/league_player_on_details_stat.rb', line 309

def off_court?
  court_status.eql?("Off")
end

#on_court? ⇒ Boolean

Returns whether the player is on court

Examples:

stat.on_court? #=> true

Returns:

  • (Boolean) —

    true if player is on court



299
300
301
# File 'lib/nba/league_player_on_details_stat.rb', line 299

def on_court?
  court_status.eql?("On")
end

#player ⇒ Player?

Returns the player object

Examples:

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

Returns:

  • (Player, nil) —

    the player object



279
280
281
# File 'lib/nba/league_player_on_details_stat.rb', line 279

def player
  Players.find(vs_player_id)
end

#team ⇒ Team?

Returns the team object

Examples:

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

Returns:

  • (Team, nil) —

    the team object



289
290
291
# File 'lib/nba/league_player_on_details_stat.rb', line 289

def team
  Teams.find(team_id)
end