Class: NBA::TeamPassStat

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

Overview

Represents team tracking pass statistics

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ast ⇒ Float

Returns assists per game

Examples:

stat.ast #=> 2.1

Returns:

  • (Float) —

    assists per game



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

attribute :ast, Shale::Type::Float

#fg2_pct ⇒ Float

Returns two-point percentage following pass

Examples:

stat.fg2_pct #=> 0.500

Returns:

  • (Float) —

    two-point percentage



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

attribute :fg2_pct, Shale::Type::Float

#fg2a ⇒ Float

Returns two-pointers attempted following pass

Examples:

stat.fg2a #=> 3.0

Returns:

  • (Float) —

    two-pointers attempted



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

attribute :fg2a, Shale::Type::Float

#fg2m ⇒ Float

Returns two-pointers made following pass

Examples:

stat.fg2m #=> 1.5

Returns:

  • (Float) —

    two-pointers made



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

attribute :fg2m, Shale::Type::Float

#fg3_pct ⇒ Float

Returns three-point percentage following pass

Examples:

stat.fg3_pct #=> 0.476

Returns:

  • (Float) —

    three-point percentage



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

attribute :fg3_pct, Shale::Type::Float

#fg3a ⇒ Float

Returns three-pointers attempted following pass

Examples:

stat.fg3a #=> 4.2

Returns:

  • (Float) —

    three-pointers attempted



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

attribute :fg3a, Shale::Type::Float

#fg3m ⇒ Float

Returns three-pointers made following pass

Examples:

stat.fg3m #=> 2.0

Returns:

  • (Float) —

    three-pointers made



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

attribute :fg3m, Shale::Type::Float

#fg_pct ⇒ Float

Returns field goal percentage following pass

Examples:

stat.fg_pct #=> 0.486

Returns:

  • (Float) —

    field goal percentage



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

attribute :fg_pct, Shale::Type::Float

#fga ⇒ Float

Returns field goals attempted following pass

Examples:

stat.fga #=> 7.2

Returns:

  • (Float) —

    field goals attempted



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

attribute :fga, Shale::Type::Float

#fgm ⇒ Float

Returns field goals made following pass

Examples:

stat.fgm #=> 3.5

Returns:

  • (Float) —

    field goals made



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

attribute :fgm, Shale::Type::Float

#frequency ⇒ Float

Returns the frequency percentage

Examples:

stat.frequency #=> 0.25

Returns:

  • (Float) —

    the frequency



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

attribute :frequency, Shale::Type::Float

#g ⇒ Integer

Returns games

Examples:

stat.g #=> 74

Returns:

  • (Integer) —

    games



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

attribute :g, Shale::Type::Integer

#pass ⇒ Float

Returns passes per game

Examples:

stat.pass #=> 5.2

Returns:

  • (Float) —

    passes per game



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

attribute :pass, Shale::Type::Float

#pass_from ⇒ String

Returns the passer name (for passes made)

Examples:

stat.pass_from #=> "Stephen Curry"

Returns:

  • (String) —

    the passer name



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

attribute :pass_from, Shale::Type::String

#pass_teammate_player_id ⇒ Integer

Returns the pass partner player ID

Examples:

stat.pass_teammate_player_id #=> 202691

Returns:

  • (Integer) —

    the teammate player ID



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

attribute :pass_teammate_player_id, Shale::Type::Integer

#pass_to ⇒ String

Returns the pass recipient name (for passes received)

Examples:

stat.pass_to #=> "Klay Thompson"

Returns:

  • (String) —

    the recipient name



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

attribute :pass_to, Shale::Type::String

#pass_type ⇒ String

Returns the type of pass

Examples:

stat.pass_type #=> "Made"

Returns:

  • (String) —

    the pass type



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

attribute :pass_type, Shale::Type::String

#team_id ⇒ Integer

Returns the team ID

Examples:

stat.team_id #=> 1610612744

Returns:

  • (Integer) —

    the team ID



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

attribute :team_id, Shale::Type::Integer

#team_name ⇒ String

Returns the team name

Examples:

stat.team_name #=> "Golden State Warriors"

Returns:

  • (String) —

    the team name



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

attribute :team_name, Shale::Type::String

Instance Method Details

#team ⇒ Team?

Returns the team object

Examples:

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

Returns:

  • (Team, nil) —

    the team object



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

def team
  Teams.find(team_id)
end

#teammate ⇒ Player?

Returns the teammate player object

Examples:

stat.teammate #=> #<NBA::Player>

Returns:

  • (Player, nil) —

    the teammate player object



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

def teammate
  Players.find(pass_teammate_player_id)
end