Class: NBA::TeamHistoricalLeader

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

Overview

Represents a team’s all-time statistical leaders

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#astInteger?

Returns the all-time assists total

Examples:

leader.ast #=> 5000

Returns:

  • (Integer, nil)

    all-time assists total



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

attribute :ast, Shale::Type::Integer

#ast_person_idInteger?

Returns the assists leader player ID

Examples:

leader.ast_person_id #=> 201939

Returns:

  • (Integer, nil)

    assists leader player ID



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

attribute :ast_person_id, Shale::Type::Integer

#ast_playerString?

Returns the assists leader player name

Examples:

leader.ast_player #=> "Stephen Curry"

Returns:

  • (String, nil)

    assists leader player name



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

attribute :ast_player, Shale::Type::String

#blkInteger?

Returns the all-time blocks total

Examples:

leader.blk #=> 1500

Returns:

  • (Integer, nil)

    all-time blocks total



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

attribute :blk, Shale::Type::Integer

#blk_person_idInteger?

Returns the blocks leader player ID

Examples:

leader.blk_person_id #=> 201142

Returns:

  • (Integer, nil)

    blocks leader player ID



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

attribute :blk_person_id, Shale::Type::Integer

#blk_playerString?

Returns the blocks leader player name

Examples:

leader.blk_player #=> "Nate Thurmond"

Returns:

  • (String, nil)

    blocks leader player name



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

attribute :blk_player, Shale::Type::String

#ptsInteger?

Returns the all-time points total

Examples:

leader.pts #=> 25000

Returns:

  • (Integer, nil)

    all-time points total



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

attribute :pts, Shale::Type::Integer

#pts_person_idInteger?

Returns the points leader player ID

Examples:

leader.pts_person_id #=> 201939

Returns:

  • (Integer, nil)

    points leader player ID



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

attribute :pts_person_id, Shale::Type::Integer

#pts_playerString?

Returns the points leader player name

Examples:

leader.pts_player #=> "Stephen Curry"

Returns:

  • (String, nil)

    points leader player name



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

attribute :pts_player, Shale::Type::String

#rebInteger?

Returns the all-time rebounds total

Examples:

leader.reb #=> 8000

Returns:

  • (Integer, nil)

    all-time rebounds total



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

attribute :reb, Shale::Type::Integer

#reb_person_idInteger?

Returns the rebounds leader player ID

Examples:

leader.reb_person_id #=> 201142

Returns:

  • (Integer, nil)

    rebounds leader player ID



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

attribute :reb_person_id, Shale::Type::Integer

#reb_playerString?

Returns the rebounds leader player name

Examples:

leader.reb_player #=> "Wilt Chamberlain"

Returns:

  • (String, nil)

    rebounds leader player name



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

attribute :reb_player, Shale::Type::String

#season_yearInteger?

Returns the season year

Examples:

leader.season_year #=> 2024

Returns:

  • (Integer, nil)

    the season year



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

attribute :season_year, Shale::Type::Integer

#stlInteger?

Returns the all-time steals total

Examples:

leader.stl #=> 1200

Returns:

  • (Integer, nil)

    all-time steals total



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

attribute :stl, Shale::Type::Integer

#stl_person_idInteger?

Returns the steals leader player ID

Examples:

leader.stl_person_id #=> 201939

Returns:

  • (Integer, nil)

    steals leader player ID



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

attribute :stl_person_id, Shale::Type::Integer

#stl_playerString?

Returns the steals leader player name

Examples:

leader.stl_player #=> "Chris Mullin"

Returns:

  • (String, nil)

    steals leader player name



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

attribute :stl_player, Shale::Type::String

#team_idInteger?

Returns the team ID

Examples:

leader.team_id #=> 1610612744

Returns:

  • (Integer, nil)

    the team ID



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

attribute :team_id, Shale::Type::Integer

Instance Method Details

#ast_leaderPlayer?

Returns the assists leader player

Examples:

leader.ast_leader #=> #<NBA::Player ...>

Returns:

  • (Player, nil)

    the assists leader



173
174
175
# File 'lib/nba/team_historical_leader.rb', line 173

def ast_leader
  Players.find(ast_person_id)
end

#blk_leaderPlayer?

Returns the blocks leader player

Examples:

leader.blk_leader #=> #<NBA::Player ...>

Returns:

  • (Player, nil)

    the blocks leader



193
194
195
# File 'lib/nba/team_historical_leader.rb', line 193

def blk_leader
  Players.find(blk_person_id)
end

#pts_leaderPlayer?

Returns the points leader player

Examples:

leader.pts_leader #=> #<NBA::Player ...>

Returns:

  • (Player, nil)

    the points leader



163
164
165
# File 'lib/nba/team_historical_leader.rb', line 163

def pts_leader
  Players.find(pts_person_id)
end

#reb_leaderPlayer?

Returns the rebounds leader player

Examples:

leader.reb_leader #=> #<NBA::Player ...>

Returns:

  • (Player, nil)

    the rebounds leader



183
184
185
# File 'lib/nba/team_historical_leader.rb', line 183

def reb_leader
  Players.find(reb_person_id)
end

#stl_leaderPlayer?

Returns the steals leader player

Examples:

leader.stl_leader #=> #<NBA::Player ...>

Returns:

  • (Player, nil)

    the steals leader



203
204
205
# File 'lib/nba/team_historical_leader.rb', line 203

def stl_leader
  Players.find(stl_person_id)
end

#teamTeam?

Returns the team for this leader record

Examples:

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

Returns:

  • (Team, nil)

    the team



153
154
155
# File 'lib/nba/team_historical_leader.rb', line 153

def team
  Teams.find(team_id)
end