Class: NBA::Franchise

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

Overview

Represents franchise history data

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#conf_titlesInteger

Returns the number of conference titles

Examples:

franchise.conf_titles #=> 7


116
# File 'lib/nba/franchise.rb', line 116

attribute :conf_titles, Shale::Type::Integer

#div_titlesInteger

Returns the number of division titles

Examples:

franchise.div_titles #=> 12


108
# File 'lib/nba/franchise.rb', line 108

attribute :div_titles, Shale::Type::Integer

#end_yearInteger

Returns the franchise end year

Examples:

franchise.end_year #=> 2024


52
# File 'lib/nba/franchise.rb', line 52

attribute :end_year, Shale::Type::Integer

#gamesInteger

Returns the total games played

Examples:

franchise.games #=> 5832


68
# File 'lib/nba/franchise.rb', line 68

attribute :games, Shale::Type::Integer

#league_idString

Returns the league ID

Examples:

franchise.league_id #=> "00"


12
# File 'lib/nba/franchise.rb', line 12

attribute :league_id, Shale::Type::String

#league_titlesInteger

Returns the number of league/NBA championships

Examples:

franchise.league_titles #=> 7


124
# File 'lib/nba/franchise.rb', line 124

attribute :league_titles, Shale::Type::Integer

#lossesInteger

Returns the total losses

Examples:

franchise.losses #=> 2852


84
# File 'lib/nba/franchise.rb', line 84

attribute :losses, Shale::Type::Integer

#po_appearancesInteger

Returns the number of playoff appearances

Examples:

franchise.po_appearances #=> 35


100
# File 'lib/nba/franchise.rb', line 100

attribute :po_appearances, Shale::Type::Integer

#start_yearInteger

Returns the franchise start year

Examples:

franchise.start_year #=> 1946


44
# File 'lib/nba/franchise.rb', line 44

attribute :start_year, Shale::Type::Integer

#team_cityString

Returns the team city

Examples:

franchise.team_city #=> "Golden State"


28
# File 'lib/nba/franchise.rb', line 28

attribute :team_city, Shale::Type::String

#team_idInteger

Returns the team ID

Examples:

franchise.team_id #=> 1610612744


20
# File 'lib/nba/franchise.rb', line 20

attribute :team_id, Shale::Type::Integer

#team_nameString

Returns the team name

Examples:

franchise.team_name #=> "Warriors"


36
# File 'lib/nba/franchise.rb', line 36

attribute :team_name, Shale::Type::String

#win_pctFloat

Returns the all-time win percentage

Examples:

franchise.win_pct #=> 0.511


92
# File 'lib/nba/franchise.rb', line 92

attribute :win_pct, Shale::Type::Float

#winsInteger

Returns the total wins

Examples:

franchise.wins #=> 2980


76
# File 'lib/nba/franchise.rb', line 76

attribute :wins, Shale::Type::Integer

#yearsInteger

Returns the number of years the franchise has existed

Examples:

franchise.years #=> 78


60
# File 'lib/nba/franchise.rb', line 60

attribute :years, Shale::Type::Integer

Instance Method Details

#teamTeam?

Returns the team object for this franchise

Examples:

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


132
133
134
# File 'lib/nba/franchise.rb', line 132

def team
  Teams.find(team_id)
end