Class: NBA::BoxScoreUsageTeamStat

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

Overview

Represents a team’s usage box score statistics for a game

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#game_idString

Returns the game ID

Examples:

stat.game_id #=> "0022400565"

Returns:

  • (String)

    the game ID



15
# File 'lib/nba/box_score_usage_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_usage_team_stat.rb', line 55

attribute :min, Shale::Type::String

#pct_astFloat

Returns percentage of assists

Examples:

stat.pct_ast #=> 1.0

Returns:

  • (Float)

    the percentage



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

attribute :pct_ast, Shale::Type::Float

#pct_blkFloat

Returns percentage of blocks

Examples:

stat.pct_blk #=> 1.0

Returns:

  • (Float)

    the percentage



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

attribute :pct_blk, Shale::Type::Float

#pct_blkaFloat

Returns percentage of blocked attempts

Examples:

stat.pct_blka #=> 1.0

Returns:

  • (Float)

    the percentage



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

attribute :pct_blka, Shale::Type::Float

#pct_drebFloat

Returns percentage of defensive rebounds

Examples:

stat.pct_dreb #=> 1.0

Returns:

  • (Float)

    the percentage



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

attribute :pct_dreb, Shale::Type::Float

#pct_fg3aFloat

Returns percentage of 3-pointers attempted

Examples:

stat.pct_fg3a #=> 1.0

Returns:

  • (Float)

    the percentage



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

attribute :pct_fg3a, Shale::Type::Float

#pct_fg3mFloat

Returns percentage of 3-pointers made

Examples:

stat.pct_fg3m #=> 1.0

Returns:

  • (Float)

    the percentage



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

attribute :pct_fg3m, Shale::Type::Float

#pct_fgaFloat

Returns percentage of field goals attempted

Examples:

stat.pct_fga #=> 1.0

Returns:

  • (Float)

    the percentage



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

attribute :pct_fga, Shale::Type::Float

#pct_fgmFloat

Returns percentage of field goals made

Examples:

stat.pct_fgm #=> 1.0

Returns:

  • (Float)

    the percentage



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

attribute :pct_fgm, Shale::Type::Float

#pct_ftaFloat

Returns percentage of free throws attempted

Examples:

stat.pct_fta #=> 1.0

Returns:

  • (Float)

    the percentage



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

attribute :pct_fta, Shale::Type::Float

#pct_ftmFloat

Returns percentage of free throws made

Examples:

stat.pct_ftm #=> 1.0

Returns:

  • (Float)

    the percentage



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

attribute :pct_ftm, Shale::Type::Float

#pct_orebFloat

Returns percentage of offensive rebounds

Examples:

stat.pct_oreb #=> 1.0

Returns:

  • (Float)

    the percentage



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

attribute :pct_oreb, Shale::Type::Float

#pct_pfFloat

Returns percentage of personal fouls

Examples:

stat.pct_pf #=> 1.0

Returns:

  • (Float)

    the percentage



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

attribute :pct_pf, Shale::Type::Float

#pct_pfdFloat

Returns percentage of personal fouls drawn

Examples:

stat.pct_pfd #=> 1.0

Returns:

  • (Float)

    the percentage



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

attribute :pct_pfd, Shale::Type::Float

#pct_ptsFloat

Returns percentage of points

Examples:

stat.pct_pts #=> 1.0

Returns:

  • (Float)

    the percentage



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

attribute :pct_pts, Shale::Type::Float

#pct_rebFloat

Returns percentage of total rebounds

Examples:

stat.pct_reb #=> 1.0

Returns:

  • (Float)

    the percentage



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

attribute :pct_reb, Shale::Type::Float

#pct_stlFloat

Returns percentage of steals

Examples:

stat.pct_stl #=> 1.0

Returns:

  • (Float)

    the percentage



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

attribute :pct_stl, Shale::Type::Float

#pct_tovFloat

Returns percentage of turnovers

Examples:

stat.pct_tov #=> 1.0

Returns:

  • (Float)

    the percentage



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

attribute :pct_tov, Shale::Type::Float

#team_abbreviationString

Returns the team abbreviation

Examples:

stat.team_abbreviation #=> "GSW"

Returns:

  • (String)

    the team abbreviation



39
# File 'lib/nba/box_score_usage_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_usage_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_usage_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_usage_team_stat.rb', line 31

attribute :team_name, Shale::Type::String

#usg_pctFloat

Returns usage percentage

Examples:

stat.usg_pct #=> 1.0

Returns:

  • (Float)

    usage percentage



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

attribute :usg_pct, Shale::Type::Float

Instance Method Details

#gameGame?

Returns the game object for this box score

Examples:

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

Returns:

  • (Game, nil)

    the game object



217
218
219
# File 'lib/nba/box_score_usage_team_stat.rb', line 217

def game
  Games.find(game_id)
end

#teamTeam?

Returns the team object

Examples:

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

Returns:

  • (Team, nil)

    the team object



207
208
209
# File 'lib/nba/box_score_usage_team_stat.rb', line 207

def team
  Teams.find(team_id)
end