Class: NBA::GameStreak
- Inherits:
-
Shale::Mapper
- Object
- Shale::Mapper
- NBA::GameStreak
- Defined in:
- lib/nba/game_streak.rb
Overview
Represents a player’s game streak statistics
Instance Attribute Summary collapse
-
#active_streak ⇒ Integer?
Returns whether the streak is active.
-
#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.
-
#player_id ⇒ Integer?
Returns the player’s unique identifier.
-
#player_name ⇒ String?
Returns the player’s name.
-
#start_date ⇒ String?
Returns the start date of the streak.
Instance Method Summary collapse
-
#active? ⇒ Boolean
Returns whether the streak is currently active.
-
#player ⇒ Player?
Returns the player associated with this streak.
Instance Attribute Details
#active_streak ⇒ Integer?
Returns whether the streak is active
56 |
# File 'lib/nba/game_streak.rb', line 56 attribute :active_streak, Shale::Type::Integer |
#end_date ⇒ String?
Returns the end date of the streak
48 |
# File 'lib/nba/game_streak.rb', line 48 attribute :end_date, Shale::Type::String |
#first_season ⇒ String?
Returns the first season of the streak
80 |
# File 'lib/nba/game_streak.rb', line 80 attribute :first_season, Shale::Type::String |
#game_streak ⇒ Integer?
Returns the number of consecutive games in the streak
32 |
# File 'lib/nba/game_streak.rb', line 32 attribute :game_streak, Shale::Type::Integer |
#last_season ⇒ String?
Returns the last season of the streak
72 |
# File 'lib/nba/game_streak.rb', line 72 attribute :last_season, Shale::Type::String |
#num_seasons ⇒ Integer?
Returns the number of seasons the streak spans
64 |
# File 'lib/nba/game_streak.rb', line 64 attribute :num_seasons, Shale::Type::Integer |
#player_id ⇒ Integer?
Returns the player’s unique identifier
24 |
# File 'lib/nba/game_streak.rb', line 24 attribute :player_id, Shale::Type::Integer |
#player_name ⇒ String?
Returns the player’s name
16 |
# File 'lib/nba/game_streak.rb', line 16 attribute :player_name, Shale::Type::String |
#start_date ⇒ String?
Returns the start date of the streak
40 |
# File 'lib/nba/game_streak.rb', line 40 attribute :start_date, Shale::Type::String |
Instance Method Details
#active? ⇒ Boolean
Returns whether the streak is currently active
88 89 90 |
# File 'lib/nba/game_streak.rb', line 88 def active? active_streak.eql?(1) end |
#player ⇒ Player?
Returns the player associated with this streak
98 99 100 |
# File 'lib/nba/game_streak.rb', line 98 def player Players.find(player_id) end |