Class: NBA::TeamGameStreak
- Inherits:
-
Shale::Mapper
- Object
- Shale::Mapper
- NBA::TeamGameStreak
- Defined in:
- lib/nba/team_game_streak.rb
Overview
Represents a team’s game streak statistics
Instance Attribute Summary collapse
-
#abbreviation ⇒ String?
Returns the team abbreviation.
-
#active_streak ⇒ Integer?
Returns whether the streak is active (1 for active, 0 for inactive).
-
#end_date ⇒ String?
Returns the end date of the streak.
-
#first_season ⇒ String?
Returns the first season of the streak.
-
#game_streak ⇒ Integer?
Returns the number of consecutive games in the streak.
-
#last_season ⇒ String?
Returns the last season of the streak.
-
#num_seasons ⇒ Integer?
Returns the number of seasons the streak spans.
-
#start_date ⇒ String?
Returns the start date of the streak.
-
#team_id ⇒ Integer?
Returns the team ID.
-
#team_name ⇒ String?
Returns the team name.
Instance Method Summary collapse
-
#active? ⇒ Boolean
Returns whether the streak is currently active.
-
#team ⇒ Team?
Returns the team associated with this streak.
Instance Attribute Details
#abbreviation ⇒ String?
Returns the team abbreviation
33 |
# File 'lib/nba/team_game_streak.rb', line 33 attribute :abbreviation, Shale::Type::String |
#active_streak ⇒ Integer?
Returns whether the streak is active (1 for active, 0 for inactive)
65 |
# File 'lib/nba/team_game_streak.rb', line 65 attribute :active_streak, Shale::Type::Integer |
#end_date ⇒ String?
Returns the end date of the streak
57 |
# File 'lib/nba/team_game_streak.rb', line 57 attribute :end_date, Shale::Type::String |
#first_season ⇒ String?
Returns the first season of the streak
89 |
# File 'lib/nba/team_game_streak.rb', line 89 attribute :first_season, Shale::Type::String |
#game_streak ⇒ Integer?
Returns the number of consecutive games in the streak
41 |
# File 'lib/nba/team_game_streak.rb', line 41 attribute :game_streak, Shale::Type::Integer |
#last_season ⇒ String?
Returns the last season of the streak
81 |
# File 'lib/nba/team_game_streak.rb', line 81 attribute :last_season, Shale::Type::String |
#num_seasons ⇒ Integer?
Returns the number of seasons the streak spans
73 |
# File 'lib/nba/team_game_streak.rb', line 73 attribute :num_seasons, Shale::Type::Integer |
#start_date ⇒ String?
Returns the start date of the streak
49 |
# File 'lib/nba/team_game_streak.rb', line 49 attribute :start_date, Shale::Type::String |
#team_id ⇒ Integer?
Returns the team ID
25 |
# File 'lib/nba/team_game_streak.rb', line 25 attribute :team_id, Shale::Type::Integer |
#team_name ⇒ String?
Returns the team name
17 |
# File 'lib/nba/team_game_streak.rb', line 17 attribute :team_name, Shale::Type::String |
Instance Method Details
#active? ⇒ Boolean
Returns whether the streak is currently active
97 98 99 |
# File 'lib/nba/team_game_streak.rb', line 97 def active? active_streak.eql?(1) end |
#team ⇒ Team?
Returns the team associated with this streak
107 108 109 |
# File 'lib/nba/team_game_streak.rb', line 107 def team Teams.find(team_id) end |