Class: NBA::LeagueSeasonMatchupStat

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

Overview

Represents a season matchup statistic between offensive and defensive players

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#def_player_idInteger?

Returns the defensive player ID

Examples:

stat.def_player_id #=> 203507

Returns:

  • (Integer, nil)

    the defensive player’s ID



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

attribute :def_player_id, Shale::Type::Integer

#def_player_nameString?

Returns the defensive player name

Examples:

stat.def_player_name #=> "Giannis Antetokounmpo"

Returns:

  • (String, nil)

    the defensive player’s name



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

attribute :def_player_name, Shale::Type::String

#gpInteger?

Returns games played

Examples:

stat.gp #=> 4

Returns:

  • (Integer, nil)

    games played



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

attribute :gp, Shale::Type::Integer

#help_blkFloat?

Returns help blocks

Examples:

stat.help_blk #=> 0.0

Returns:

  • (Float, nil)

    help blocks



171
# File 'lib/nba/league_season_matchup_stat.rb', line 171

attribute :help_blk, Shale::Type::Float

#help_fg_pctFloat?

Returns help field goal percentage

Examples:

stat.help_fg_pct #=> 0.500

Returns:

  • (Float, nil)

    help field goal percentage



195
# File 'lib/nba/league_season_matchup_stat.rb', line 195

attribute :help_fg_pct, Shale::Type::Float

#help_fgaFloat?

Returns help field goals attempted

Examples:

stat.help_fga #=> 2.0

Returns:

  • (Float, nil)

    help field goals attempted



187
# File 'lib/nba/league_season_matchup_stat.rb', line 187

attribute :help_fga, Shale::Type::Float

#help_fgmFloat?

Returns help field goals made

Examples:

stat.help_fgm #=> 1.0

Returns:

  • (Float, nil)

    help field goals made



179
# File 'lib/nba/league_season_matchup_stat.rb', line 179

attribute :help_fgm, Shale::Type::Float

#matchup_astFloat?

Returns assists during matchup

Examples:

stat.matchup_ast #=> 3.0

Returns:

  • (Float, nil)

    matchup assists



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

attribute :matchup_ast, Shale::Type::Float

#matchup_blkFloat?

Returns blocks during matchup

Examples:

stat.matchup_blk #=> 0.5

Returns:

  • (Float, nil)

    matchup blocks



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

attribute :matchup_blk, Shale::Type::Float

#matchup_fg3_pctFloat?

Returns three-point percentage during matchup

Examples:

stat.matchup_fg3_pct #=> 0.333

Returns:

  • (Float, nil)

    matchup three-point percentage



163
# File 'lib/nba/league_season_matchup_stat.rb', line 163

attribute :matchup_fg3_pct, Shale::Type::Float

#matchup_fg3aFloat?

Returns three-pointers attempted during matchup

Examples:

stat.matchup_fg3a #=> 6.0

Returns:

  • (Float, nil)

    matchup three-pointers attempted



155
# File 'lib/nba/league_season_matchup_stat.rb', line 155

attribute :matchup_fg3a, Shale::Type::Float

#matchup_fg3mFloat?

Returns three-pointers made during matchup

Examples:

stat.matchup_fg3m #=> 2.0

Returns:

  • (Float, nil)

    matchup three-pointers made



147
# File 'lib/nba/league_season_matchup_stat.rb', line 147

attribute :matchup_fg3m, Shale::Type::Float

#matchup_fg_pctFloat?

Returns field goal percentage during matchup

Examples:

stat.matchup_fg_pct #=> 0.429

Returns:

  • (Float, nil)

    matchup field goal percentage



139
# File 'lib/nba/league_season_matchup_stat.rb', line 139

attribute :matchup_fg_pct, Shale::Type::Float

#matchup_fgaFloat?

Returns field goals attempted during matchup

Examples:

stat.matchup_fga #=> 14.0

Returns:

  • (Float, nil)

    matchup field goals attempted



131
# File 'lib/nba/league_season_matchup_stat.rb', line 131

attribute :matchup_fga, Shale::Type::Float

#matchup_fgmFloat?

Returns field goals made during matchup

Examples:

stat.matchup_fgm #=> 6.0

Returns:

  • (Float, nil)

    matchup field goals made



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

attribute :matchup_fgm, Shale::Type::Float

#matchup_ftaFloat?

Returns free throws attempted during matchup

Examples:

stat.matchup_fta #=> 5.0

Returns:

  • (Float, nil)

    matchup free throws attempted



211
# File 'lib/nba/league_season_matchup_stat.rb', line 211

attribute :matchup_fta, Shale::Type::Float

#matchup_ftmFloat?

Returns free throws made during matchup

Examples:

stat.matchup_ftm #=> 4.0

Returns:

  • (Float, nil)

    matchup free throws made



203
# File 'lib/nba/league_season_matchup_stat.rb', line 203

attribute :matchup_ftm, Shale::Type::Float

#matchup_minFloat?

Returns matchup minutes

Examples:

stat.matchup_min #=> 12.5

Returns:

  • (Float, nil)

    matchup minutes



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

attribute :matchup_min, Shale::Type::Float

#matchup_tovFloat?

Returns turnovers during matchup

Examples:

stat.matchup_tov #=> 1.0

Returns:

  • (Float, nil)

    matchup turnovers



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

attribute :matchup_tov, Shale::Type::Float

#off_player_idInteger?

Returns the offensive player ID

Examples:

stat.off_player_id #=> 201939

Returns:

  • (Integer, nil)

    the offensive player’s ID



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

attribute :off_player_id, Shale::Type::Integer

#off_player_nameString?

Returns the offensive player name

Examples:

stat.off_player_name #=> "Stephen Curry"

Returns:

  • (String, nil)

    the offensive player’s name



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

attribute :off_player_name, Shale::Type::String

#partial_possFloat?

Returns partial possessions

Examples:

stat.partial_poss #=> 45.2

Returns:

  • (Float, nil)

    partial possessions



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

attribute :partial_poss, Shale::Type::Float

#player_ptsFloat?

Returns points scored by offensive player

Examples:

stat.player_pts #=> 18.0

Returns:

  • (Float, nil)

    player points



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

attribute :player_pts, Shale::Type::Float

#season_idString?

Returns the season ID

Examples:

stat.season_id #=> "22024"

Returns:

  • (String, nil)

    the season ID



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

attribute :season_id, Shale::Type::String

#sflFloat?

Returns shooting fouls drawn

Examples:

stat.sfl #=> 2.0

Returns:

  • (Float, nil)

    shooting fouls



219
# File 'lib/nba/league_season_matchup_stat.rb', line 219

attribute :sfl, Shale::Type::Float

#team_ptsFloat?

Returns team points during matchup

Examples:

stat.team_pts #=> 22.0

Returns:

  • (Float, nil)

    team points



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

attribute :team_pts, Shale::Type::Float

Instance Method Details

#def_playerPlayer?

Returns the defensive player

Examples:

stat.def_player #=> #<NBA::Player id=203507 ...>

Returns:

  • (Player, nil)

    the defensive player object



237
238
239
# File 'lib/nba/league_season_matchup_stat.rb', line 237

def def_player
  Players.find(def_player_id)
end

#off_playerPlayer?

Returns the offensive player

Examples:

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

Returns:

  • (Player, nil)

    the offensive player object



227
228
229
# File 'lib/nba/league_season_matchup_stat.rb', line 227

def off_player
  Players.find(off_player_id)
end