Class: NBA::LeagueLineupVizStat

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

Overview

Represents a lineup visualization statistic

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#def_ratingFloat?

Returns defensive rating

Examples:

stat.def_rating #=> 108.5

Returns:

  • (Float, nil)

    defensive rating



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

attribute :def_rating, Shale::Type::Float

#fta_rateFloat?

Returns free throw attempt rate

Examples:

stat.fta_rate #=> 0.285

Returns:

  • (Float, nil)

    free throw attempt rate



98
# File 'lib/nba/league_lineup_viz_stat.rb', line 98

attribute :fta_rate, Shale::Type::Float

#group_idString?

Returns the lineup group ID

Examples:

stat.group_id #=> "201939-203110-1628369"

Returns:

  • (String, nil)

    the group ID



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

attribute :group_id, Shale::Type::String

#group_nameString?

Returns the lineup group name (player names)

Examples:

stat.group_name #=> "S. Curry - K. Thompson - A. Wiggins"

Returns:

  • (String, nil)

    the group name



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

attribute :group_name, Shale::Type::String

#minFloat?

Returns minutes played

Examples:

stat.min #=> 245.5

Returns:

  • (Float, nil)

    minutes played



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

attribute :min, Shale::Type::Float

#net_ratingFloat?

Returns net rating

Examples:

stat.net_rating #=> 6.8

Returns:

  • (Float, nil)

    net rating



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

attribute :net_rating, Shale::Type::Float

#off_ratingFloat?

Returns offensive rating

Examples:

stat.off_rating #=> 115.3

Returns:

  • (Float, nil)

    offensive rating



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

attribute :off_rating, Shale::Type::Float

#opp_efg_pctFloat?

Returns opponent effective FG percentage

Examples:

stat.opp_efg_pct #=> 0.512

Returns:

  • (Float, nil)

    opponent effective FG percentage



186
# File 'lib/nba/league_lineup_viz_stat.rb', line 186

attribute :opp_efg_pct, Shale::Type::Float

#opp_fg3_pctFloat?

Returns opponent 3-point percentage

Examples:

stat.opp_fg3_pct #=> 0.352

Returns:

  • (Float, nil)

    opponent 3-point percentage



178
# File 'lib/nba/league_lineup_viz_stat.rb', line 178

attribute :opp_fg3_pct, Shale::Type::Float

#opp_fta_rateFloat?

Returns opponent FTA rate

Examples:

stat.opp_fta_rate #=> 0.275

Returns:

  • (Float, nil)

    opponent FTA rate



194
# File 'lib/nba/league_lineup_viz_stat.rb', line 194

attribute :opp_fta_rate, Shale::Type::Float

#opp_tov_pctFloat?

Returns opponent turnover percentage

Examples:

stat.opp_tov_pct #=> 0.132

Returns:

  • (Float, nil)

    opponent turnover percentage



202
# File 'lib/nba/league_lineup_viz_stat.rb', line 202

attribute :opp_tov_pct, Shale::Type::Float

#paceFloat?

Returns pace

Examples:

stat.pace #=> 101.2

Returns:

  • (Float, nil)

    pace



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

attribute :pace, Shale::Type::Float

#pct_ast_fgmFloat?

Returns percentage of FGM that were assisted

Examples:

stat.pct_ast_fgm #=> 0.652

Returns:

  • (Float, nil)

    percentage of FGM that were assisted



162
# File 'lib/nba/league_lineup_viz_stat.rb', line 162

attribute :pct_ast_fgm, Shale::Type::Float

#pct_fga_2ptFloat?

Returns percentage of FGA that are 2-pointers

Examples:

stat.pct_fga_2pt #=> 0.545

Returns:

  • (Float, nil)

    percentage of FGA that are 2-pointers



114
# File 'lib/nba/league_lineup_viz_stat.rb', line 114

attribute :pct_fga_2pt, Shale::Type::Float

#pct_fga_3ptFloat?

Returns percentage of FGA that are 3-pointers

Examples:

stat.pct_fga_3pt #=> 0.455

Returns:

  • (Float, nil)

    percentage of FGA that are 3-pointers



122
# File 'lib/nba/league_lineup_viz_stat.rb', line 122

attribute :pct_fga_3pt, Shale::Type::Float

#pct_pts_2pt_mrFloat?

Returns percentage of points from mid-range 2s

Examples:

stat.pct_pts_2pt_mr #=> 0.125

Returns:

  • (Float, nil)

    percentage of points from mid-range 2s



130
# File 'lib/nba/league_lineup_viz_stat.rb', line 130

attribute :pct_pts_2pt_mr, Shale::Type::Float

#pct_pts_fbFloat?

Returns percentage of points from fast breaks

Examples:

stat.pct_pts_fb #=> 0.152

Returns:

  • (Float, nil)

    percentage of points from fast breaks



138
# File 'lib/nba/league_lineup_viz_stat.rb', line 138

attribute :pct_pts_fb, Shale::Type::Float

#pct_pts_ftFloat?

Returns percentage of points from free throws

Examples:

stat.pct_pts_ft #=> 0.185

Returns:

  • (Float, nil)

    percentage of points from free throws



146
# File 'lib/nba/league_lineup_viz_stat.rb', line 146

attribute :pct_pts_ft, Shale::Type::Float

#pct_pts_paintFloat?

Returns percentage of points in paint

Examples:

stat.pct_pts_paint #=> 0.425

Returns:

  • (Float, nil)

    percentage of points in paint



154
# File 'lib/nba/league_lineup_viz_stat.rb', line 154

attribute :pct_pts_paint, Shale::Type::Float

#pct_uast_fgmFloat?

Returns percentage of FGM that were unassisted

Examples:

stat.pct_uast_fgm #=> 0.348

Returns:

  • (Float, nil)

    percentage of FGM that were unassisted



170
# File 'lib/nba/league_lineup_viz_stat.rb', line 170

attribute :pct_uast_fgm, Shale::Type::Float

#team_abbreviationString?

Returns the team abbreviation

Examples:

stat.team_abbreviation #=> "GSW"

Returns:

  • (String, nil)

    the team abbreviation



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

attribute :team_abbreviation, Shale::Type::String

#team_idInteger?

Returns the team ID

Examples:

stat.team_id #=> 1610612744

Returns:

  • (Integer, nil)

    the team ID



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

attribute :team_id, Shale::Type::Integer

#tm_ast_pctFloat?

Returns team assist percentage

Examples:

stat.tm_ast_pct #=> 0.652

Returns:

  • (Float, nil)

    team assist percentage



106
# File 'lib/nba/league_lineup_viz_stat.rb', line 106

attribute :tm_ast_pct, Shale::Type::Float

#ts_pctFloat?

Returns true shooting percentage

Examples:

stat.ts_pct #=> 0.612

Returns:

  • (Float, nil)

    true shooting percentage



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

attribute :ts_pct, Shale::Type::Float

Instance Method Details

#teamTeam?

Returns the team

Examples:

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

Returns:

  • (Team, nil)

    the team object



210
211
212
# File 'lib/nba/league_lineup_viz_stat.rb', line 210

def team
  Teams.find(team_id)
end