Class: NBA::TeamShotStat

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

Overview

Represents team tracking shot statistics

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#efg_pctFloat?

Returns effective field goal percentage

Examples:

stat.efg_pct #=> 0.561

Returns:

  • (Float, nil)

    effective field goal percentage



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

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



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

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



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

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



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

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



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

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



161
# File 'lib/nba/team_shot_stat.rb', line 161

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



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

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



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

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



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

attribute :fg3m, Shale::Type::Float

#fg_pctFloat?

Returns field goal percentage

Examples:

stat.fg_pct #=> 0.472

Returns:

  • (Float, nil)

    field goal percentage



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

attribute :fg_pct, Shale::Type::Float

#fgaFloat?

Returns field goals attempted

Examples:

stat.fga #=> 15.3

Returns:

  • (Float, nil)

    field goals attempted



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

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



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

attribute :fga_frequency, Shale::Type::Float

#fgmFloat?

Returns field goals made

Examples:

stat.fgm #=> 7.2

Returns:

  • (Float, nil)

    field goals made



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

attribute :fgm, Shale::Type::Float

#gInteger?

Returns number of games

Examples:

stat.g #=> 74

Returns:

  • (Integer, nil)

    games



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

attribute :g, Shale::Type::Integer

#shot_typeString?

Returns the shot type or category

Examples:

stat.shot_type #=> "Catch and Shoot"

Returns:

  • (String, nil)

    the shot type or category



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

attribute :shot_type, Shale::Type::String

#sort_orderInteger?

Returns the sort order

Examples:

stat.sort_order #=> 1

Returns:

  • (Integer, nil)

    the sort order



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

attribute :sort_order, Shale::Type::Integer

#team_abbreviationString?

Returns the team abbreviation

Examples:

stat.team_abbreviation #=> "GSW"

Returns:

  • (String, nil)

    the team abbreviation



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

attribute :team_abbreviation, Shale::Type::String

#team_idInteger?

Returns the team ID

Examples:

stat.team_id #=> 1610612744

Returns:

  • (Integer, nil)

    the team’s ID



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

attribute :team_id, Shale::Type::Integer

#team_nameString?

Returns the team name

Examples:

stat.team_name #=> "Golden State Warriors"

Returns:

  • (String, nil)

    the team’s name



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

attribute :team_name, Shale::Type::String

Instance Method Details

#teamTeam?

Returns the team associated with this stat

Examples:

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

Returns:

  • (Team, nil)

    the Team object



169
170
171
# File 'lib/nba/team_shot_stat.rb', line 169

def team
  Teams.find(team_id)
end