Class: NBA::FranchiseLeader

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

Overview

Represents franchise leaders in various statistical categories

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#astInteger

Returns the total assists by the leader

Examples:

leader.ast #=> 5845

Returns:

  • (Integer)

    the total assists



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

attribute :ast, Shale::Type::Integer

#ast_person_idInteger

Returns the person ID of the assists leader

Examples:

leader.ast_person_id #=> 201939

Returns:

  • (Integer)

    the assists leader’s person ID



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

attribute :ast_person_id, Shale::Type::Integer

#ast_player_nameString

Returns the name of the assists leader

Examples:

leader.ast_player_name #=> "Stephen Curry"

Returns:

  • (String)

    the assists leader’s name



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

attribute :ast_player_name, Shale::Type::String

#blkInteger

Returns the total blocks by the leader

Examples:

leader.blk #=> 2086

Returns:

  • (Integer)

    the total blocks



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

attribute :blk, Shale::Type::Integer

#blk_person_idInteger

Returns the person ID of the blocks leader

Examples:

leader.blk_person_id #=> 2442

Returns:

  • (Integer)

    the blocks leader’s person ID



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

attribute :blk_person_id, Shale::Type::Integer

#blk_player_nameString

Returns the name of the blocks leader

Examples:

leader.blk_player_name #=> "Manute Bol"

Returns:

  • (String)

    the blocks leader’s name



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

attribute :blk_player_name, Shale::Type::String

#ptsInteger

Returns the total points scored by the leader

Examples:

leader.pts #=> 23668

Returns:

  • (Integer)

    the total points



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

attribute :pts, Shale::Type::Integer

#pts_person_idInteger

Returns the person ID of the points leader

Examples:

leader.pts_person_id #=> 201939

Returns:

  • (Integer)

    the points leader’s person ID



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

attribute :pts_person_id, Shale::Type::Integer

#pts_player_nameString

Returns the name of the points leader

Examples:

leader.pts_player_name #=> "Stephen Curry"

Returns:

  • (String)

    the points leader’s name



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

attribute :pts_player_name, Shale::Type::String

#rebInteger

Returns the total rebounds by the leader

Examples:

leader.reb #=> 12771

Returns:

  • (Integer)

    the total rebounds



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

attribute :reb, Shale::Type::Integer

#reb_person_idInteger

Returns the person ID of the rebounds leader

Examples:

leader.reb_person_id #=> 600015

Returns:

  • (Integer)

    the rebounds leader’s person ID



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

attribute :reb_person_id, Shale::Type::Integer

#reb_player_nameString

Returns the name of the rebounds leader

Examples:

leader.reb_player_name #=> "Nate Thurmond"

Returns:

  • (String)

    the rebounds leader’s name



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

attribute :reb_player_name, Shale::Type::String

#stlInteger

Returns the total steals by the leader

Examples:

leader.stl #=> 1360

Returns:

  • (Integer)

    the total steals



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

attribute :stl, Shale::Type::Integer

#stl_person_idInteger

Returns the person ID of the steals leader

Examples:

leader.stl_person_id #=> 959

Returns:

  • (Integer)

    the steals leader’s person ID



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

attribute :stl_person_id, Shale::Type::Integer

#stl_player_nameString

Returns the name of the steals leader

Examples:

leader.stl_player_name #=> "Chris Mullin"

Returns:

  • (String)

    the steals leader’s name



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

attribute :stl_player_name, Shale::Type::String

#team_idInteger

Returns the team ID

Examples:

leader.team_id #=> 1610612744

Returns:

  • (Integer)

    the team ID



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

attribute :team_id, Shale::Type::Integer

Instance Method Details

#teamTeam?

Returns the team object for this franchise

Examples:

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

Returns:

  • (Team, nil)

    the team object



143
144
145
# File 'lib/nba/franchise_leader.rb', line 143

def team
  Teams.find(team_id)
end