Class: NBA::TeamInfo

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

Overview

Represents team information from the TeamInfoCommon endpoint

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#conf_rankInteger?

Returns conference rank

Examples:

info.conf_rank #=> 4


114
# File 'lib/nba/team_info.rb', line 114

attribute :conf_rank, Shale::Type::Integer

#div_rankInteger?

Returns division rank

Examples:

info.div_rank #=> 2


122
# File 'lib/nba/team_info.rb', line 122

attribute :div_rank, Shale::Type::Integer

#lInteger?

Returns losses

Examples:

info.l #=> 36


98
# File 'lib/nba/team_info.rb', line 98

attribute :l, Shale::Type::Integer

#max_yearString?

Returns the maximum year

Examples:

info.max_year #=> "2024"


138
# File 'lib/nba/team_info.rb', line 138

attribute :max_year, Shale::Type::String

#min_yearString?

Returns the minimum year (franchise founding year)

Examples:

info.min_year #=> "1946"


130
# File 'lib/nba/team_info.rb', line 130

attribute :min_year, Shale::Type::String

#pctFloat?

Returns win percentage

Examples:

info.pct #=> 0.561


106
# File 'lib/nba/team_info.rb', line 106

attribute :pct, Shale::Type::Float

#season_yearString?

Returns the season year

Examples:

info.season_year #=> "2024-25"


26
# File 'lib/nba/team_info.rb', line 26

attribute :season_year, Shale::Type::String

#team_abbreviationString?

Returns the team abbreviation

Examples:

info.team_abbreviation #=> "GSW"


50
# File 'lib/nba/team_info.rb', line 50

attribute :team_abbreviation, Shale::Type::String

#team_cityString?

Returns the team city

Examples:

info.team_city #=> "Golden State"


34
# File 'lib/nba/team_info.rb', line 34

attribute :team_city, Shale::Type::String

#team_codeString?

Returns the team code

Examples:

info.team_code #=> "warriors"


74
# File 'lib/nba/team_info.rb', line 74

attribute :team_code, Shale::Type::String

#team_conferenceString?

Returns the team conference

Examples:

info.team_conference #=> "West"


58
# File 'lib/nba/team_info.rb', line 58

attribute :team_conference, Shale::Type::String

#team_divisionString?

Returns the team division

Examples:

info.team_division #=> "Pacific"


66
# File 'lib/nba/team_info.rb', line 66

attribute :team_division, Shale::Type::String

#team_idInteger?

Returns the team ID

Examples:

info.team_id #=> 1610612744


18
# File 'lib/nba/team_info.rb', line 18

attribute :team_id, Shale::Type::Integer

#team_nameString?

Returns the team name

Examples:

info.team_name #=> "Warriors"


42
# File 'lib/nba/team_info.rb', line 42

attribute :team_name, Shale::Type::String

#team_slugString?

Returns the team slug

Examples:

info.team_slug #=> "warriors"


82
# File 'lib/nba/team_info.rb', line 82

attribute :team_slug, Shale::Type::String

#wInteger?

Returns wins

Examples:

info.w #=> 46


90
# File 'lib/nba/team_info.rb', line 90

attribute :w, Shale::Type::Integer

Instance Method Details

#teamTeam?

Returns the team associated with this info

Examples:

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


146
147
148
# File 'lib/nba/team_info.rb', line 146

def team
  Teams.find(team_id)
end