Class: NBA::BoxScoreFourFactorsTeamStat

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

Overview

Represents a team’s four factors box score statistics for a game

API:

  • public

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#efg_pctFloat

Returns effective field goal percentage

Examples:

stat.efg_pct #=> 0.562

Returns:

  • the effective field goal percentage

API:

  • public



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

attribute :efg_pct, Shale::Type::Float

#fta_rateFloat

Returns free throw attempt rate

Examples:

stat.fta_rate #=> 0.284

Returns:

  • the free throw attempt rate

API:

  • public



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

attribute :fta_rate, Shale::Type::Float

#game_idString

Returns the game ID

Examples:

stat.game_id #=> "0022400350"

Returns:

  • the game ID

API:

  • public



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

attribute :game_id, Shale::Type::String

#minString

Returns total minutes played

Examples:

stat.min #=> "240:00"

Returns:

  • the minutes

API:

  • public



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

attribute :min, Shale::Type::String

#opp_efg_pctFloat

Returns opponent effective field goal percentage

Examples:

stat.opp_efg_pct #=> 0.485

Returns:

  • the opponent effective field goal percentage

API:

  • public



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

attribute :opp_efg_pct, Shale::Type::Float

#opp_fta_rateFloat

Returns opponent free throw attempt rate

Examples:

stat.opp_fta_rate #=> 0.310

Returns:

  • the opponent free throw attempt rate

API:

  • public



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

attribute :opp_fta_rate, Shale::Type::Float

#opp_oreb_pctFloat

Returns opponent offensive rebound percentage

Examples:

stat.opp_oreb_pct #=> 20.5

Returns:

  • the opponent offensive rebound percentage

API:

  • public



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

attribute :opp_oreb_pct, Shale::Type::Float

#opp_tov_pctFloat

Returns opponent turnover percentage

Examples:

stat.opp_tov_pct #=> 17.8

Returns:

  • the opponent turnover percentage

API:

  • public



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

attribute :opp_tov_pct, Shale::Type::Float

#oreb_pctFloat

Returns offensive rebound percentage

Examples:

stat.oreb_pct #=> 22.2

Returns:

  • the offensive rebound percentage

API:

  • public



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

attribute :oreb_pct, Shale::Type::Float

#team_abbreviationString

Returns the team abbreviation

Examples:

stat.team_abbreviation #=> "GSW"

Returns:

  • the team abbreviation

API:

  • public



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

attribute :team_abbreviation, Shale::Type::String

#team_cityString

Returns the team city

Examples:

stat.team_city #=> "Golden State"

Returns:

  • the team city

API:

  • public



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

attribute :team_city, Shale::Type::String

#team_idInteger

Returns the team ID

Examples:

stat.team_id #=> 1610612744

Returns:

  • the team ID

API:

  • public



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

attribute :team_id, Shale::Type::Integer

#team_nameString

Returns the team name

Examples:

stat.team_name #=> "Warriors"

Returns:

  • the team name

API:

  • public



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

attribute :team_name, Shale::Type::String

#tov_pctFloat

Returns turnover percentage

Examples:

stat.tov_pct #=> 14.5

Returns:

  • the turnover percentage

API:

  • public



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

attribute :tov_pct, Shale::Type::Float

Instance Method Details

#gameGame?

Returns the game object for this box score

Examples:

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

Returns:

  • the game object

API:

  • public



137
138
139
# File 'lib/nba/box_score_four_factors_team_stat.rb', line 137

def game
  Games.find(game_id)
end

#teamTeam?

Returns the team object

Examples:

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

Returns:

  • the team object

API:

  • public



127
128
129
# File 'lib/nba/box_score_four_factors_team_stat.rb', line 127

def team
  Teams.find(team_id)
end