Class: NBA::DefensiveShotStat

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

Overview

Represents a player’s defensive shot statistics

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#close_def_person_idInteger?

Returns the defender’s player ID

Examples:

stat.close_def_person_id #=> 201939

Returns:

  • (Integer, nil)

    the defender’s player ID



18
# File 'lib/nba/defensive_shot_stat.rb', line 18

attribute :close_def_person_id, Shale::Type::Integer

#d_fg_pctFloat?

Returns defended field goal percentage

Examples:

stat.d_fg_pct #=> 0.396

Returns:

  • (Float, nil)

    defended field goal percentage



74
# File 'lib/nba/defensive_shot_stat.rb', line 74

attribute :d_fg_pct, Shale::Type::Float

#d_fgaFloat?

Returns defended field goals attempted

Examples:

stat.d_fga #=> 5.3

Returns:

  • (Float, nil)

    defended field goals attempted



66
# File 'lib/nba/defensive_shot_stat.rb', line 66

attribute :d_fga, Shale::Type::Float

#d_fgmFloat?

Returns defended field goals made

Examples:

stat.d_fgm #=> 2.1

Returns:

  • (Float, nil)

    defended field goals made



58
# File 'lib/nba/defensive_shot_stat.rb', line 58

attribute :d_fgm, Shale::Type::Float

#defense_categoryString?

Returns the defensive category

Examples:

stat.defense_category #=> "3 Pointers"

Returns:

  • (String, nil)

    the defensive category



42
# File 'lib/nba/defensive_shot_stat.rb', line 42

attribute :defense_category, Shale::Type::String

#freqFloat?

Returns the frequency

Examples:

stat.freq #=> 0.25

Returns:

  • (Float, nil)

    frequency



50
# File 'lib/nba/defensive_shot_stat.rb', line 50

attribute :freq, Shale::Type::Float

#gInteger?

Returns number of games

Examples:

stat.g #=> 74

Returns:

  • (Integer, nil)

    games



34
# File 'lib/nba/defensive_shot_stat.rb', line 34

attribute :g, Shale::Type::Integer

#gpInteger?

Returns games played

Examples:

stat.gp #=> 74

Returns:

  • (Integer, nil)

    games played



26
# File 'lib/nba/defensive_shot_stat.rb', line 26

attribute :gp, Shale::Type::Integer

#normal_fg_pctFloat?

Returns normal field goal percentage

Examples:

stat.normal_fg_pct #=> 0.401

Returns:

  • (Float, nil)

    normal field goal percentage



82
# File 'lib/nba/defensive_shot_stat.rb', line 82

attribute :normal_fg_pct, Shale::Type::Float

#pct_plusminusFloat?

Returns percentage plus/minus

Examples:

stat.pct_plusminus #=> -0.005

Returns:

  • (Float, nil)

    percentage plus/minus



90
# File 'lib/nba/defensive_shot_stat.rb', line 90

attribute :pct_plusminus, Shale::Type::Float

Instance Method Details

#playerPlayer?

Returns the player who defended the shots

Examples:

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

Returns:

  • (Player, nil)

    the player object



98
99
100
# File 'lib/nba/defensive_shot_stat.rb', line 98

def player
  Players.find(close_def_person_id)
end