Class: NBA::AssistTrackerEntry

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

Overview

Represents an assist tracker entry (pass to score)

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#astInteger

Returns the number of assists

Examples:

entry.ast #=> 32


81
# File 'lib/nba/assist_tracker_entry.rb', line 81

attribute :ast, Shale::Type::Integer

#fg2_pctFloat

Returns the 2-point field goal percentage

Examples:

entry.fg2_pct #=> 0.667


129
# File 'lib/nba/assist_tracker_entry.rb', line 129

attribute :fg2_pct, Shale::Type::Float

#fg2aInteger

Returns the 2-point field goal attempts

Examples:

entry.fg2a #=> 30


121
# File 'lib/nba/assist_tracker_entry.rb', line 121

attribute :fg2a, Shale::Type::Integer

#fg2mInteger

Returns the 2-point field goals made

Examples:

entry.fg2m #=> 20


113
# File 'lib/nba/assist_tracker_entry.rb', line 113

attribute :fg2m, Shale::Type::Integer

#fg3_pctFloat

Returns the 3-point field goal percentage

Examples:

entry.fg3_pct #=> 0.533


153
# File 'lib/nba/assist_tracker_entry.rb', line 153

attribute :fg3_pct, Shale::Type::Float

#fg3aInteger

Returns the 3-point field goal attempts

Examples:

entry.fg3a #=> 15


145
# File 'lib/nba/assist_tracker_entry.rb', line 145

attribute :fg3a, Shale::Type::Integer

#fg3mInteger

Returns the 3-point field goals made

Examples:

entry.fg3m #=> 8


137
# File 'lib/nba/assist_tracker_entry.rb', line 137

attribute :fg3m, Shale::Type::Integer

#fg_aInteger

Returns the field goal attempts

Examples:

entry.fg_a #=> 45


97
# File 'lib/nba/assist_tracker_entry.rb', line 97

attribute :fg_a, Shale::Type::Integer

#fg_mInteger

Returns the field goals made

Examples:

entry.fg_m #=> 28


89
# File 'lib/nba/assist_tracker_entry.rb', line 89

attribute :fg_m, Shale::Type::Integer

#fg_pctFloat

Returns the field goal percentage

Examples:

entry.fg_pct #=> 0.622


105
# File 'lib/nba/assist_tracker_entry.rb', line 105

attribute :fg_pct, Shale::Type::Float

#frequencyFloat

Returns the frequency of this pass combination

Examples:

entry.frequency #=> 0.123


65
# File 'lib/nba/assist_tracker_entry.rb', line 65

attribute :frequency, Shale::Type::Float

#passInteger

Returns the number of passes

Examples:

entry.pass #=> 45


73
# File 'lib/nba/assist_tracker_entry.rb', line 73

attribute :pass, Shale::Type::Integer

#pass_toString

Returns the name of the player receiving the pass

Examples:

entry.pass_to #=> "Kawhi Leonard"


49
# File 'lib/nba/assist_tracker_entry.rb', line 49

attribute :pass_to, Shale::Type::String

#pass_to_player_idInteger

Returns the ID of the player receiving the pass

Examples:

entry.pass_to_player_id #=> 202695


57
# File 'lib/nba/assist_tracker_entry.rb', line 57

attribute :pass_to_player_id, Shale::Type::Integer

#player_idInteger

Returns the passer’s player ID

Examples:

entry.player_id #=> 201566


17
# File 'lib/nba/assist_tracker_entry.rb', line 17

attribute :player_id, Shale::Type::Integer

#player_nameString

Returns the passer’s name

Examples:

entry.player_name #=> "Russell Westbrook"


25
# File 'lib/nba/assist_tracker_entry.rb', line 25

attribute :player_name, Shale::Type::String

#team_abbreviationString

Returns the team abbreviation

Examples:

entry.team_abbreviation #=> "LAC"


41
# File 'lib/nba/assist_tracker_entry.rb', line 41

attribute :team_abbreviation, Shale::Type::String

#team_idInteger

Returns the team ID

Examples:

entry.team_id #=> 1610612746


33
# File 'lib/nba/assist_tracker_entry.rb', line 33

attribute :team_id, Shale::Type::Integer

Instance Method Details

#pass_to_playerPlayer?

Returns the receiver player object

Examples:

entry.pass_to_player #=> #<NBA::Player>


171
172
173
# File 'lib/nba/assist_tracker_entry.rb', line 171

def pass_to_player
  Players.find(pass_to_player_id)
end

#playerPlayer?

Returns the passer player object

Examples:

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


161
162
163
# File 'lib/nba/assist_tracker_entry.rb', line 161

def player
  Players.find(player_id)
end

#teamTeam?

Returns the team object

Examples:

entry.team #=> #<NBA::Team>


181
182
183
# File 'lib/nba/assist_tracker_entry.rb', line 181

def team
  Teams.find(team_id)
end