Class: NBA::Team

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

Overview

Represents an NBA team

Team ID Constants collapse

ATL =

Atlanta Hawks team ID

Returns:

  • (Integer)

    the team ID

1_610_612_737
BOS =

Boston Celtics team ID

Returns:

  • (Integer)

    the team ID

1_610_612_738
BKN =

Brooklyn Nets team ID

Returns:

  • (Integer)

    the team ID

1_610_612_751
CHA =

Charlotte Hornets team ID

Returns:

  • (Integer)

    the team ID

1_610_612_766
CHI =

Chicago Bulls team ID

Returns:

  • (Integer)

    the team ID

1_610_612_741
CLE =

Cleveland Cavaliers team ID

Returns:

  • (Integer)

    the team ID

1_610_612_739
DAL =

Dallas Mavericks team ID

Returns:

  • (Integer)

    the team ID

1_610_612_742
DEN =

Denver Nuggets team ID

Returns:

  • (Integer)

    the team ID

1_610_612_743
DET =

Detroit Pistons team ID

Returns:

  • (Integer)

    the team ID

1_610_612_765
GSW =

Golden State Warriors team ID

Returns:

  • (Integer)

    the team ID

1_610_612_744
HOU =

Houston Rockets team ID

Returns:

  • (Integer)

    the team ID

1_610_612_745
IND =

Indiana Pacers team ID

Returns:

  • (Integer)

    the team ID

1_610_612_754
LAC =

Los Angeles Clippers team ID

Returns:

  • (Integer)

    the team ID

1_610_612_746
LAL =

Los Angeles Lakers team ID

Returns:

  • (Integer)

    the team ID

1_610_612_747
MEM =

Memphis Grizzlies team ID

Returns:

  • (Integer)

    the team ID

1_610_612_763
MIA =

Miami Heat team ID

Returns:

  • (Integer)

    the team ID

1_610_612_748
MIL =

Milwaukee Bucks team ID

Returns:

  • (Integer)

    the team ID

1_610_612_749
MIN =

Minnesota Timberwolves team ID

Returns:

  • (Integer)

    the team ID

1_610_612_750
NOP =

New Orleans Pelicans team ID

Returns:

  • (Integer)

    the team ID

1_610_612_740
NYK =

New York Knicks team ID

Returns:

  • (Integer)

    the team ID

1_610_612_752
OKC =

Oklahoma City Thunder team ID

Returns:

  • (Integer)

    the team ID

1_610_612_760
ORL =

Orlando Magic team ID

Returns:

  • (Integer)

    the team ID

1_610_612_753
PHI =

Philadelphia 76ers team ID

Returns:

  • (Integer)

    the team ID

1_610_612_755
PHX =

Phoenix Suns team ID

Returns:

  • (Integer)

    the team ID

1_610_612_756
POR =

Portland Trail Blazers team ID

Returns:

  • (Integer)

    the team ID

1_610_612_757
SAC =

Sacramento Kings team ID

Returns:

  • (Integer)

    the team ID

1_610_612_758
SAS =

San Antonio Spurs team ID

Returns:

  • (Integer)

    the team ID

1_610_612_759
TOR =

Toronto Raptors team ID

Returns:

  • (Integer)

    the team ID

1_610_612_761
UTA =

Utah Jazz team ID

Returns:

  • (Integer)

    the team ID

1_610_612_762
WAS =

Washington Wizards team ID

Returns:

  • (Integer)

    the team ID

1_610_612_764

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#abbreviationString

Returns the team abbreviation

Examples:

team.abbreviation #=> "LAL"

Returns:

  • (String)

    the team abbreviation



136
# File 'lib/nba/team.rb', line 136

attribute :abbreviation, Shale::Type::String

#cityString

Returns the team’s city

Examples:

team.city #=> "Los Angeles"

Returns:

  • (String)

    the team’s city



152
# File 'lib/nba/team.rb', line 152

attribute :city, Shale::Type::String

#conferenceConference

Returns the team’s conference

Examples:

team.conference #=> #<NBA::Conference>

Returns:



176
# File 'lib/nba/team.rb', line 176

attribute :conference, Conference

#divisionDivision

Returns the team’s division

Examples:

team.division #=> #<NBA::Division>

Returns:



184
# File 'lib/nba/team.rb', line 184

attribute :division, Division

#full_nameString

Returns the team’s full name

Examples:

team.full_name #=> "Los Angeles Lakers"

Returns:

  • (String)

    the team’s full name



128
# File 'lib/nba/team.rb', line 128

attribute :full_name, Shale::Type::String

#idInteger

Returns the unique identifier for the team

Examples:

team.id #=> 1610612747

Returns:

  • (Integer)

    the unique identifier for the team



112
# File 'lib/nba/team.rb', line 112

attribute :id, Shale::Type::Integer

#nameString

Returns the team name

Examples:

team.name #=> "Los Angeles Lakers"

Returns:

  • (String)

    the team name



120
# File 'lib/nba/team.rb', line 120

attribute :name, Shale::Type::String

#nicknameString

Returns the team nickname

Examples:

team.nickname #=> "Lakers"

Returns:

  • (String)

    the team nickname



144
# File 'lib/nba/team.rb', line 144

attribute :nickname, Shale::Type::String

#stateString

Returns the team’s state

Examples:

team.state #=> "California"

Returns:

  • (String)

    the team’s state



160
# File 'lib/nba/team.rb', line 160

attribute :state, Shale::Type::String

#year_foundedInteger

Returns the year the team was founded

Examples:

team.year_founded #=> 1947

Returns:

  • (Integer)

    the year the team was founded



168
# File 'lib/nba/team.rb', line 168

attribute :year_founded, Shale::Type::Integer

Instance Method Details

#arenaString?

Returns the team’s home arena

Examples:

team.arena #=> "Chase Center"

Returns:

  • (String, nil)

    the arena name



207
208
209
# File 'lib/nba/team.rb', line 207

def arena
  TeamDetails.find(team: id)&.arena
end