Class: NBA::AssistLeader

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

Overview

Represents an assist leader entry

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#astInteger

Returns the total assists

Examples:

leader.ast #=> 654

Returns:

  • (Integer)

    the total assists



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

attribute :ast, Shale::Type::Integer

#player_idInteger

Returns the player ID

Examples:

leader.player_id #=> 201566

Returns:

  • (Integer)

    the player ID



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

attribute :player_id, Shale::Type::Integer

#player_nameString

Returns the player name

Examples:

leader.player_name #=> "Russell Westbrook"

Returns:

  • (String)

    the player name



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

attribute :player_name, Shale::Type::String

#rankInteger

Returns the rank in the category

Examples:

leader.rank #=> 1

Returns:

  • (Integer)

    the rank



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

attribute :rank, Shale::Type::Integer

#team_abbreviationString

Returns the team abbreviation

Examples:

leader.team_abbreviation #=> "LAC"

Returns:

  • (String)

    the team abbreviation



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

attribute :team_abbreviation, Shale::Type::String

#team_idInteger

Returns the team ID

Examples:

leader.team_id #=> 1610612746

Returns:

  • (Integer)

    the team ID



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

attribute :team_id, Shale::Type::Integer

Instance Method Details

#playerPlayer?

Returns the player object for this leader

Examples:

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

Returns:

  • (Player, nil)

    the hydrated player object



65
66
67
# File 'lib/nba/assist_leader.rb', line 65

def player
  Players.find(player_id)
end

#teamTeam?

Returns the team object for this leader

Examples:

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

Returns:

  • (Team, nil)

    the team object



75
76
77
# File 'lib/nba/assist_leader.rb', line 75

def team
  Teams.find(team_id)
end