Class: NBA::TeamDetail

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

Overview

Represents detailed team information

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#abbreviationString

Returns the team abbreviation

Examples:

detail.abbreviation #=> "GSW"

Returns:

  • (String)

    the abbreviation



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

attribute :abbreviation, Shale::Type::String

#arenaString

Returns the team’s home arena

Examples:

detail.arena #=> "Chase Center"

Returns:

  • (String)

    the arena



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

attribute :arena, Shale::Type::String

#arena_capacityInteger

Returns the arena capacity

Examples:

detail.arena_capacity #=> 18064

Returns:

  • (Integer)

    the capacity



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

attribute :arena_capacity, Shale::Type::Integer

#cityString

Returns the team city

Examples:

detail.city #=> "Golden State"

Returns:

  • (String)

    the city



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

attribute :city, Shale::Type::String

#d_league_affiliationString

Returns the G League affiliate

Examples:

detail.d_league_affiliation #=> "Santa Cruz Warriors"

Returns:

  • (String)

    the G League affiliate



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

attribute :d_league_affiliation, Shale::Type::String

#general_managerString

Returns the general manager

Examples:

detail.general_manager #=> "Mike Dunleavy Jr."

Returns:

  • (String)

    the general manager



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

attribute :general_manager, Shale::Type::String

#head_coachString

Returns the head coach

Examples:

detail.head_coach #=> "Steve Kerr"

Returns:

  • (String)

    the head coach



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

attribute :head_coach, Shale::Type::String

#nicknameString

Returns the team nickname

Examples:

detail.nickname #=> "Warriors"

Returns:

  • (String)

    the nickname



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

attribute :nickname, Shale::Type::String

#ownerString

Returns the team owner

Examples:

detail.owner #=> "Joe Lacob"

Returns:

  • (String)

    the owner



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

attribute :owner, Shale::Type::String

#team_idInteger

Returns the team ID

Examples:

detail.team_id #=> 1610612744

Returns:

  • (Integer)

    the team ID



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

attribute :team_id, Shale::Type::Integer

#year_foundedInteger

Returns the year the team was founded

Examples:

detail.year_founded #=> 1946

Returns:

  • (Integer)

    the year founded



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

attribute :year_founded, Shale::Type::Integer

Instance Method Details

#full_nameString

Returns the full team name

Examples:

detail.full_name #=> "Golden State Warriors"

Returns:

  • (String)

    the full name



113
114
115
# File 'lib/nba/team_detail.rb', line 113

def full_name
  "#{city} #{nickname}".strip
end

#teamTeam?

Returns the team object

Examples:

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

Returns:

  • (Team, nil)

    the team object



103
104
105
# File 'lib/nba/team_detail.rb', line 103

def team
  Teams.find(team_id)
end