Class: NBA::TeamHistoricalRecord

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

Overview

Represents a team’s historical record

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cityString

Returns the team city

Examples:

record.city #=> "Golden State"

Returns:

  • (String)

    the city



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

attribute :city, Shale::Type::String

#conf_countInteger

Returns conference titles

Examples:

record.conf_count #=> 0

Returns:

  • (Integer)

    the conference titles



111
# File 'lib/nba/team_historical_record.rb', line 111

attribute :conf_count, Shale::Type::Integer

#conf_rankInteger

Returns the conference rank

Examples:

record.conf_rank #=> 10

Returns:

  • (Integer)

    the conference rank



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

attribute :conf_rank, Shale::Type::Integer

#div_countInteger

Returns division titles

Examples:

record.div_count #=> 0

Returns:

  • (Integer)

    the division titles



119
# File 'lib/nba/team_historical_record.rb', line 119

attribute :div_count, Shale::Type::Integer

#div_rankInteger

Returns the division rank

Examples:

record.div_rank #=> 3

Returns:

  • (Integer)

    the division rank



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

attribute :div_rank, Shale::Type::Integer

#lossesInteger

Returns the number of losses

Examples:

record.losses #=> 36

Returns:

  • (Integer)

    the losses



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

attribute :losses, Shale::Type::Integer

#nba_finals_appearanceString

Returns NBA Finals appearances

Examples:

record.nba_finals_appearance #=> "N/A"

Returns:

  • (String)

    the Finals appearances



127
# File 'lib/nba/team_historical_record.rb', line 127

attribute :nba_finals_appearance, Shale::Type::String

#nicknameString

Returns the team nickname

Examples:

record.nickname #=> "Warriors"

Returns:

  • (String)

    the nickname



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

attribute :nickname, Shale::Type::String

#po_lossesInteger

Returns playoff losses

Examples:

record.po_losses #=> 0

Returns:

  • (Integer)

    the playoff losses



103
# File 'lib/nba/team_historical_record.rb', line 103

attribute :po_losses, Shale::Type::Integer

#po_winsInteger

Returns playoff wins

Examples:

record.po_wins #=> 0

Returns:

  • (Integer)

    the playoff wins



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

attribute :po_wins, Shale::Type::Integer

#season_idString

Returns the season ID

Examples:

record.season_id #=> "22024"

Returns:

  • (String)

    the season ID



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

attribute :season_id, Shale::Type::String

#team_idInteger

Returns the team ID

Examples:

record.team_id #=> 1610612744

Returns:

  • (Integer)

    the team ID



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

attribute :team_id, Shale::Type::Integer

#win_pctFloat

Returns the win percentage

Examples:

record.win_pct #=> 0.561

Returns:

  • (Float)

    the win percentage



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

attribute :win_pct, Shale::Type::Float

#winsInteger

Returns the number of wins

Examples:

record.wins #=> 46

Returns:

  • (Integer)

    the wins



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

attribute :wins, Shale::Type::Integer

#yearInteger

Returns the year

Examples:

record.year #=> 2024

Returns:

  • (Integer)

    the year



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

attribute :year, Shale::Type::Integer

Instance Method Details

#teamTeam?

Returns the team object

Examples:

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

Returns:

  • (Team, nil)

    the team object



135
136
137
# File 'lib/nba/team_historical_record.rb', line 135

def team
  Teams.find(team_id)
end