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

#abbreviation ⇒ String

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

#arena ⇒ String

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_capacity ⇒ Integer

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

#city ⇒ String

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_affiliation ⇒ String

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_manager ⇒ String

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_coach ⇒ String

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

#nickname ⇒ String

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

#owner ⇒ String

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_id ⇒ Integer

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_founded ⇒ Integer

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_name ⇒ String

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

#team ⇒ Team?

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