Class: NBA::BoxScoreTeamStat

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

Overview

Represents a team’s box score statistics for a game

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#astInteger

Returns assists

Examples:

stat.ast #=> 28

Returns:

  • (Integer)

    assists



159
# File 'lib/nba/box_score_team_stat.rb', line 159

attribute :ast, Shale::Type::Integer

#blkInteger

Returns blocks

Examples:

stat.blk #=> 6

Returns:

  • (Integer)

    blocks



175
# File 'lib/nba/box_score_team_stat.rb', line 175

attribute :blk, Shale::Type::Integer

#drebInteger

Returns defensive rebounds

Examples:

stat.dreb #=> 35

Returns:

  • (Integer)

    defensive rebounds



143
# File 'lib/nba/box_score_team_stat.rb', line 143

attribute :dreb, Shale::Type::Integer

#fg3_pctFloat

Returns three-point percentage

Examples:

stat.fg3_pct #=> 0.395

Returns:

  • (Float)

    three-point percentage



103
# File 'lib/nba/box_score_team_stat.rb', line 103

attribute :fg3_pct, Shale::Type::Float

#fg3aInteger

Returns three-pointers attempted

Examples:

stat.fg3a #=> 38

Returns:

  • (Integer)

    three-pointers attempted



95
# File 'lib/nba/box_score_team_stat.rb', line 95

attribute :fg3a, Shale::Type::Integer

#fg3mInteger

Returns three-pointers made

Examples:

stat.fg3m #=> 15

Returns:

  • (Integer)

    three-pointers made



87
# File 'lib/nba/box_score_team_stat.rb', line 87

attribute :fg3m, Shale::Type::Integer

#fg_pctFloat

Returns field goal percentage

Examples:

stat.fg_pct #=> 0.477

Returns:

  • (Float)

    field goal percentage



79
# File 'lib/nba/box_score_team_stat.rb', line 79

attribute :fg_pct, Shale::Type::Float

#fgaInteger

Returns field goals attempted

Examples:

stat.fga #=> 88

Returns:

  • (Integer)

    field goals attempted



71
# File 'lib/nba/box_score_team_stat.rb', line 71

attribute :fga, Shale::Type::Integer

#fgmInteger

Returns field goals made

Examples:

stat.fgm #=> 42

Returns:

  • (Integer)

    field goals made



63
# File 'lib/nba/box_score_team_stat.rb', line 63

attribute :fgm, Shale::Type::Integer

#ft_pctFloat

Returns free throw percentage

Examples:

stat.ft_pct #=> 0.800

Returns:

  • (Float)

    free throw percentage



127
# File 'lib/nba/box_score_team_stat.rb', line 127

attribute :ft_pct, Shale::Type::Float

#ftaInteger

Returns free throws attempted

Examples:

stat.fta #=> 25

Returns:

  • (Integer)

    free throws attempted



119
# File 'lib/nba/box_score_team_stat.rb', line 119

attribute :fta, Shale::Type::Integer

#ftmInteger

Returns free throws made

Examples:

stat.ftm #=> 20

Returns:

  • (Integer)

    free throws made



111
# File 'lib/nba/box_score_team_stat.rb', line 111

attribute :ftm, Shale::Type::Integer

#game_idString

Returns the game ID

Examples:

stat.game_id #=> "0022400350"

Returns:

  • (String)

    the game ID



15
# File 'lib/nba/box_score_team_stat.rb', line 15

attribute :game_id, Shale::Type::String

#minString

Returns total minutes played

Examples:

stat.min #=> "240:00"

Returns:

  • (String)

    the minutes



55
# File 'lib/nba/box_score_team_stat.rb', line 55

attribute :min, Shale::Type::String

#orebInteger

Returns offensive rebounds

Examples:

stat.oreb #=> 10

Returns:

  • (Integer)

    offensive rebounds



135
# File 'lib/nba/box_score_team_stat.rb', line 135

attribute :oreb, Shale::Type::Integer

#pfInteger

Returns personal fouls

Examples:

stat.pf #=> 18

Returns:

  • (Integer)

    personal fouls



191
# File 'lib/nba/box_score_team_stat.rb', line 191

attribute :pf, Shale::Type::Integer

#plus_minusInteger

Returns plus/minus

Examples:

stat.plus_minus #=> 8

Returns:

  • (Integer)

    plus/minus



207
# File 'lib/nba/box_score_team_stat.rb', line 207

attribute :plus_minus, Shale::Type::Integer

#ptsInteger

Returns points

Examples:

stat.pts #=> 119

Returns:

  • (Integer)

    points



199
# File 'lib/nba/box_score_team_stat.rb', line 199

attribute :pts, Shale::Type::Integer

#rebInteger

Returns total rebounds

Examples:

stat.reb #=> 45

Returns:

  • (Integer)

    total rebounds



151
# File 'lib/nba/box_score_team_stat.rb', line 151

attribute :reb, Shale::Type::Integer

#stlInteger

Returns steals

Examples:

stat.stl #=> 9

Returns:

  • (Integer)

    steals



167
# File 'lib/nba/box_score_team_stat.rb', line 167

attribute :stl, Shale::Type::Integer

#team_abbreviationString

Returns the team abbreviation

Examples:

stat.team_abbreviation #=> "GSW"

Returns:

  • (String)

    the team abbreviation



39
# File 'lib/nba/box_score_team_stat.rb', line 39

attribute :team_abbreviation, Shale::Type::String

#team_cityString

Returns the team city

Examples:

stat.team_city #=> "Golden State"

Returns:

  • (String)

    the team city



47
# File 'lib/nba/box_score_team_stat.rb', line 47

attribute :team_city, Shale::Type::String

#team_idInteger

Returns the team ID

Examples:

stat.team_id #=> 1610612744

Returns:

  • (Integer)

    the team ID



23
# File 'lib/nba/box_score_team_stat.rb', line 23

attribute :team_id, Shale::Type::Integer

#team_nameString

Returns the team name

Examples:

stat.team_name #=> "Warriors"

Returns:

  • (String)

    the team name



31
# File 'lib/nba/box_score_team_stat.rb', line 31

attribute :team_name, Shale::Type::String

#tovInteger

Returns turnovers

Examples:

stat.tov #=> 14

Returns:

  • (Integer)

    turnovers



183
# File 'lib/nba/box_score_team_stat.rb', line 183

attribute :tov, Shale::Type::Integer

Instance Method Details

#gameGame?

Returns the game object for this box score

Examples:

stat.game #=> #<NBA::Game>

Returns:

  • (Game, nil)

    the game object



225
226
227
# File 'lib/nba/box_score_team_stat.rb', line 225

def game
  Games.find(game_id)
end

#teamTeam?

Returns the team object

Examples:

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

Returns:

  • (Team, nil)

    the team object



215
216
217
# File 'lib/nba/box_score_team_stat.rb', line 215

def team
  Teams.find(team_id)
end