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

Returns:

  • (Integer)

    the number of assists



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

Returns:

  • (Float)

    the 2-point field goal percentage



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

Returns:

  • (Integer)

    the 2-point field goal attempts



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

Returns:

  • (Integer)

    the 2-point field goals made



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

Returns:

  • (Float)

    the 3-point field goal percentage



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

Returns:

  • (Integer)

    the 3-point field goal attempts



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

Returns:

  • (Integer)

    the 3-point field goals made



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

Returns:

  • (Integer)

    the field goal attempts



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

Returns:

  • (Integer)

    the field goals made



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

Returns:

  • (Float)

    the field goal percentage



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

Returns:

  • (Float)

    the frequency



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

Returns:

  • (Integer)

    the number of passes



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"

Returns:

  • (String)

    the receiver’s name



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

Returns:

  • (Integer)

    the receiver’s player ID



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

Returns:

  • (Integer)

    the passer’s player ID



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"

Returns:

  • (String)

    the passer’s name



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"

Returns:

  • (String)

    the team abbreviation



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

Returns:

  • (Integer)

    the team ID



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>

Returns:

  • (Player, nil)

    the receiver player object



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>

Returns:

  • (Player, nil)

    the passer player object



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>

Returns:

  • (Team, nil)

    the team object



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

def team
  Teams.find(team_id)
end