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

Returns:

  • (Float, nil)

    the player’s age



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

Returns:

  • (Float, nil)

    defended field goal percentage



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

Returns:

  • (Float, nil)

    defended field goals attempted



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

Returns:

  • (Float, nil)

    defended field goals made



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

Returns:

  • (Float, nil)

    frequency percentage



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

Returns:

  • (Integer, nil)

    games



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

Returns:

  • (Integer, nil)

    games played



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

Returns:

  • (Float, nil)

    normal field goal percentage



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

Returns:

  • (Float, nil)

    percentage plus/minus



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

Returns:

  • (Integer, nil)

    the player’s ID



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"

Returns:

  • (String, nil)

    the player’s name



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"

Returns:

  • (String, nil)

    the player’s position



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"

Returns:

  • (String, nil)

    the team’s abbreviation



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

Returns:

  • (Integer, nil)

    the team’s ID



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 ...>

Returns:

  • (Player, nil)

    the player object



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 ...>

Returns:

  • (Team, nil)

    the team object



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

def team
  Teams.find(team_id)
end