Class: NBA::EstimatedMetricsStat

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

Overview

Represents player estimated metrics

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#e_ast_ratioFloat

Returns estimated assist ratio

Examples:

stat.e_ast_ratio #=> 25.5

Returns:

  • (Float)

    estimated assist ratio



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

attribute :e_ast_ratio, Shale::Type::Float

#e_def_ratingFloat

Returns estimated defensive rating

Examples:

stat.e_def_rating #=> 110.2

Returns:

  • (Float)

    estimated defensive rating



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

attribute :e_def_rating, Shale::Type::Float

#e_dreb_pctFloat

Returns estimated defensive rebound percentage

Examples:

stat.e_dreb_pct #=> 15.5

Returns:

  • (Float)

    estimated defensive rebound percentage



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

attribute :e_dreb_pct, Shale::Type::Float

#e_net_ratingFloat

Returns estimated net rating

Examples:

stat.e_net_rating #=> 7.3

Returns:

  • (Float)

    estimated net rating



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

attribute :e_net_rating, Shale::Type::Float

#e_off_ratingFloat

Returns estimated offensive rating

Examples:

stat.e_off_rating #=> 117.5

Returns:

  • (Float)

    estimated offensive rating



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

attribute :e_off_rating, Shale::Type::Float

#e_oreb_pctFloat

Returns estimated offensive rebound percentage

Examples:

stat.e_oreb_pct #=> 2.5

Returns:

  • (Float)

    estimated offensive rebound percentage



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

attribute :e_oreb_pct, Shale::Type::Float

#e_paceFloat

Returns estimated pace

Examples:

stat.e_pace #=> 101.5

Returns:

  • (Float)

    estimated pace



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

attribute :e_pace, Shale::Type::Float

#e_reb_pctFloat

Returns estimated rebound percentage

Examples:

stat.e_reb_pct #=> 9.5

Returns:

  • (Float)

    estimated rebound percentage



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

attribute :e_reb_pct, Shale::Type::Float

#e_tov_pctFloat

Returns estimated turnover percentage

Examples:

stat.e_tov_pct #=> 11.5

Returns:

  • (Float)

    estimated turnover percentage



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

attribute :e_tov_pct, Shale::Type::Float

#e_usg_pctFloat

Returns estimated usage percentage

Examples:

stat.e_usg_pct #=> 31.5

Returns:

  • (Float)

    estimated usage percentage



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

attribute :e_usg_pct, Shale::Type::Float

#gpInteger

Returns games played

Examples:

stat.gp #=> 74

Returns:

  • (Integer)

    games played



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

attribute :gp, Shale::Type::Integer

#lInteger

Returns losses

Examples:

stat.l #=> 28

Returns:

  • (Integer)

    losses



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

attribute :l, Shale::Type::Integer

#minFloat

Returns minutes per game

Examples:

stat.min #=> 32.7

Returns:

  • (Float)

    minutes



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

attribute :min, Shale::Type::Float

#player_idInteger

Returns the player ID

Examples:

stat.player_id #=> 201939

Returns:

  • (Integer)

    the player ID



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

attribute :player_id, Shale::Type::Integer

#player_nameString

Returns the player name

Examples:

stat.player_name #=> "Stephen Curry"

Returns:

  • (String)

    the player name



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

attribute :player_name, Shale::Type::String

#wInteger

Returns wins

Examples:

stat.w #=> 46

Returns:

  • (Integer)

    wins



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

attribute :w, Shale::Type::Integer

#w_pctFloat

Returns win percentage

Examples:

stat.w_pct #=> 0.622

Returns:

  • (Float)

    win percentage



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

attribute :w_pct, Shale::Type::Float

Instance Method Details

#playerPlayer?

Returns the player object

Examples:

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

Returns:

  • (Player, nil)

    the player object



148
149
150
# File 'lib/nba/estimated_metrics_stat.rb', line 148

def player
  Players.find(player_id)
end