Class: NBA::TeamSeasonRank

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

Overview

Represents team season rankings from the TeamInfoCommon endpoint

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ast_pgFloat?

Returns the assists per game

Examples:

rank.ast_pg #=> 28.7

Returns:

  • (Float, nil)

    the assists per game



82
# File 'lib/nba/team_season_rank.rb', line 82

attribute :ast_pg, Shale::Type::Float

#ast_rankInteger?

Returns the assists per game rank

Examples:

rank.ast_rank #=> 3

Returns:

  • (Integer, nil)

    the assists rank



74
# File 'lib/nba/team_season_rank.rb', line 74

attribute :ast_rank, Shale::Type::Integer

#league_idString?

Returns the league ID

Examples:

rank.league_id #=> "00"

Returns:

  • (String, nil)

    the league ID



18
# File 'lib/nba/team_season_rank.rb', line 18

attribute :league_id, Shale::Type::String

#opp_pts_pgFloat?

Returns the opponent points per game

Examples:

rank.opp_pts_pg #=> 115.2

Returns:

  • (Float, nil)

    the opponent points per game



98
# File 'lib/nba/team_season_rank.rb', line 98

attribute :opp_pts_pg, Shale::Type::Float

#opp_pts_rankInteger?

Returns the opponent points per game rank

Examples:

rank.opp_pts_rank #=> 15

Returns:

  • (Integer, nil)

    the opponent points rank



90
# File 'lib/nba/team_season_rank.rb', line 90

attribute :opp_pts_rank, Shale::Type::Integer

#pts_pgFloat?

Returns the points per game

Examples:

rank.pts_pg #=> 118.9

Returns:

  • (Float, nil)

    the points per game



50
# File 'lib/nba/team_season_rank.rb', line 50

attribute :pts_pg, Shale::Type::Float

#pts_rankInteger?

Returns the points per game rank

Examples:

rank.pts_rank #=> 5

Returns:

  • (Integer, nil)

    the points rank



42
# File 'lib/nba/team_season_rank.rb', line 42

attribute :pts_rank, Shale::Type::Integer

#reb_pgFloat?

Returns the rebounds per game

Examples:

rank.reb_pg #=> 44.2

Returns:

  • (Float, nil)

    the rebounds per game



66
# File 'lib/nba/team_season_rank.rb', line 66

attribute :reb_pg, Shale::Type::Float

#reb_rankInteger?

Returns the rebounds per game rank

Examples:

rank.reb_rank #=> 12

Returns:

  • (Integer, nil)

    the rebounds rank



58
# File 'lib/nba/team_season_rank.rb', line 58

attribute :reb_rank, Shale::Type::Integer

#season_idString?

Returns the season ID

Examples:

rank.season_id #=> "2024-25"

Returns:

  • (String, nil)

    the season ID



26
# File 'lib/nba/team_season_rank.rb', line 26

attribute :season_id, Shale::Type::String

#team_idInteger?

Returns the team ID

Examples:

rank.team_id #=> 1610612744

Returns:

  • (Integer, nil)

    the team's ID



34
# File 'lib/nba/team_season_rank.rb', line 34

attribute :team_id, Shale::Type::Integer

Instance Method Details

#teamTeam?

Returns the team associated with this rank

Examples:

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

Returns:

  • (Team, nil)

    the Team object



106
107
108
# File 'lib/nba/team_season_rank.rb', line 106

def team
  Teams.find(team_id)
end