Class: NBA::LeagueDashPtDefendStat

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

Overview

Represents league-wide player defensive statistics

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ageFloat?

Returns the player’s age

Examples:

stat.age #=> 36.0


59
# File 'lib/nba/league_dash_pt_defend_stat.rb', line 59

attribute :age, Shale::Type::Float

#d_fg_pctFloat?

Returns defended field goal percentage

Examples:

stat.d_fg_pct #=> 0.400


107
# File 'lib/nba/league_dash_pt_defend_stat.rb', line 107

attribute :d_fg_pct, Shale::Type::Float

#d_fgaFloat?

Returns defended field goals attempted

Examples:

stat.d_fga #=> 612


99
# File 'lib/nba/league_dash_pt_defend_stat.rb', line 99

attribute :d_fga, Shale::Type::Float

#d_fgmFloat?

Returns defended field goals made

Examples:

stat.d_fgm #=> 245


91
# File 'lib/nba/league_dash_pt_defend_stat.rb', line 91

attribute :d_fgm, Shale::Type::Float

#freqFloat?

Returns frequency percentage

Examples:

stat.freq #=> 0.089


83
# File 'lib/nba/league_dash_pt_defend_stat.rb', line 83

attribute :freq, Shale::Type::Float

#gInteger?

Returns games (alias for games played)

Examples:

stat.g #=> 82


75
# File 'lib/nba/league_dash_pt_defend_stat.rb', line 75

attribute :g, Shale::Type::Integer

#gpInteger?

Returns games played

Examples:

stat.gp #=> 82


67
# File 'lib/nba/league_dash_pt_defend_stat.rb', line 67

attribute :gp, Shale::Type::Integer

#normal_fg_pctFloat?

Returns normal (uncontested) field goal percentage

Examples:

stat.normal_fg_pct #=> 0.450


115
# File 'lib/nba/league_dash_pt_defend_stat.rb', line 115

attribute :normal_fg_pct, Shale::Type::Float

#pct_plusminusFloat?

Returns percentage plus/minus (difference from normal)

Examples:

stat.pct_plusminus #=> -0.050


123
# File 'lib/nba/league_dash_pt_defend_stat.rb', line 123

attribute :pct_plusminus, Shale::Type::Float

#player_idInteger?

Returns the player ID (close defender)

Examples:

stat.player_id #=> 201939


19
# File 'lib/nba/league_dash_pt_defend_stat.rb', line 19

attribute :player_id, Shale::Type::Integer

#player_nameString?

Returns the player name

Examples:

stat.player_name #=> "Stephen Curry"


27
# File 'lib/nba/league_dash_pt_defend_stat.rb', line 27

attribute :player_name, Shale::Type::String

#player_positionString?

Returns the player’s position

Examples:

stat.player_position #=> "G"


51
# File 'lib/nba/league_dash_pt_defend_stat.rb', line 51

attribute :player_position, Shale::Type::String

#team_abbreviationString?

Returns the player’s last team abbreviation

Examples:

stat.team_abbreviation #=> "GSW"


43
# File 'lib/nba/league_dash_pt_defend_stat.rb', line 43

attribute :team_abbreviation, Shale::Type::String

#team_idInteger?

Returns the player’s last team ID

Examples:

stat.team_id #=> 1610612744


35
# File 'lib/nba/league_dash_pt_defend_stat.rb', line 35

attribute :team_id, Shale::Type::Integer

Instance Method Details

#playerPlayer?

Returns the player

Examples:

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


131
132
133
# File 'lib/nba/league_dash_pt_defend_stat.rb', line 131

def player
  Players.find(player_id)
end

#teamTeam?

Returns the team

Examples:

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


141
142
143
# File 'lib/nba/league_dash_pt_defend_stat.rb', line 141

def team
  Teams.find(team_id)
end