Class: NBA::LeagueDashPlayerPtShotStat

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

Overview

Represents league-wide player tracking shot statistics

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ageFloat?

Returns the player’s age

Examples:

stat.age #=> 36

Returns:

  • (Float, nil)

    the player’s age



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

attribute :age, Shale::Type::Float

#efg_pctFloat?

Returns effective field goal percentage

Examples:

stat.efg_pct #=> 0.561

Returns:

  • (Float, nil)

    effective field goal percentage



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

attribute :efg_pct, Shale::Type::Float

#fg2_pctFloat?

Returns 2-point field goal percentage

Examples:

stat.fg2_pct #=> 0.526

Returns:

  • (Float, nil)

    2-point field goal percentage



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

attribute :fg2_pct, Shale::Type::Float

#fg2aFloat?

Returns 2-point field goals attempted

Examples:

stat.fg2a #=> 7.8

Returns:

  • (Float, nil)

    2-point field goals attempted



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

attribute :fg2a, Shale::Type::Float

#fg2a_frequencyFloat?

Returns 2-point field goal attempt frequency

Examples:

stat.fg2a_frequency #=> 0.45

Returns:

  • (Float, nil)

    2-point field goal attempt frequency



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

attribute :fg2a_frequency, Shale::Type::Float

#fg2mFloat?

Returns 2-point field goals made

Examples:

stat.fg2m #=> 4.1

Returns:

  • (Float, nil)

    2-point field goals made



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

attribute :fg2m, Shale::Type::Float

#fg3_pctFloat?

Returns 3-point field goal percentage

Examples:

stat.fg3_pct #=> 0.428

Returns:

  • (Float, nil)

    3-point field goal percentage



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

attribute :fg3_pct, Shale::Type::Float

#fg3aFloat?

Returns 3-point field goals attempted

Examples:

stat.fg3a #=> 11.2

Returns:

  • (Float, nil)

    3-point field goals attempted



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

attribute :fg3a, Shale::Type::Float

#fg3a_frequencyFloat?

Returns 3-point field goal attempt frequency

Examples:

stat.fg3a_frequency #=> 0.55

Returns:

  • (Float, nil)

    3-point field goal attempt frequency



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

attribute :fg3a_frequency, Shale::Type::Float

#fg3mFloat?

Returns 3-point field goals made

Examples:

stat.fg3m #=> 4.8

Returns:

  • (Float, nil)

    3-point field goals made



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

attribute :fg3m, Shale::Type::Float

#fg_pctFloat?

Returns field goal percentage

Examples:

stat.fg_pct #=> 0.472

Returns:

  • (Float, nil)

    field goal percentage



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

attribute :fg_pct, Shale::Type::Float

#fgaFloat?

Returns field goals attempted

Examples:

stat.fga #=> 15.3

Returns:

  • (Float, nil)

    field goals attempted



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

attribute :fga, Shale::Type::Float

#fga_frequencyFloat?

Returns field goal attempt frequency

Examples:

stat.fga_frequency #=> 0.35

Returns:

  • (Float, nil)

    field goal attempt frequency



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

attribute :fga_frequency, Shale::Type::Float

#fgmFloat?

Returns field goals made

Examples:

stat.fgm #=> 7.2

Returns:

  • (Float, nil)

    field goals made



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

attribute :fgm, Shale::Type::Float

#gInteger?

Returns number of games

Examples:

stat.g #=> 74

Returns:

  • (Integer, nil)

    games



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

attribute :g, Shale::Type::Integer

#gpInteger?

Returns games played

Examples:

stat.gp #=> 74

Returns:

  • (Integer, nil)

    games played



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

attribute :gp, Shale::Type::Integer

#player_idInteger?

Returns the player ID

Examples:

stat.player_id #=> 201939

Returns:

  • (Integer, nil)

    the player’s ID



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

attribute :player_id, Shale::Type::Integer

#player_last_team_abbreviationString?

Returns the player’s last team abbreviation

Examples:

stat.player_last_team_abbreviation #=> "GSW"

Returns:

  • (String, nil)

    the team’s abbreviation



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

attribute :player_last_team_abbreviation, Shale::Type::String

#player_last_team_idInteger?

Returns the player’s last team ID

Examples:

stat.player_last_team_id #=> 1610612744

Returns:

  • (Integer, nil)

    the team’s ID



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

attribute :player_last_team_id, Shale::Type::Integer

#player_nameString?

Returns the player name

Examples:

stat.player_name #=> "Stephen Curry"

Returns:

  • (String, nil)

    the player’s name



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

attribute :player_name, Shale::Type::String

Instance Method Details

#playerPlayer?

Returns the player

Examples:

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

Returns:

  • (Player, nil)

    the player object



179
180
181
# File 'lib/nba/league_dash_player_pt_shot_stat.rb', line 179

def player
  Players.find(player_id)
end

#teamTeam?

Returns the player’s team

Examples:

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

Returns:

  • (Team, nil)

    the team object



189
190
191
# File 'lib/nba/league_dash_player_pt_shot_stat.rb', line 189

def team
  Teams.find(player_last_team_id)
end