Class: NBA::LiveGame
- Inherits:
-
Shale::Mapper
- Object
- Shale::Mapper
- NBA::LiveGame
- Defined in:
- lib/nba/live_game.rb
Overview
Represents a live game from the NBA Live Data API
Instance Attribute Summary collapse
-
#away_team_city ⇒ String
Returns the away team city.
-
#away_team_id ⇒ Integer
Returns the away team ID.
-
#away_team_name ⇒ String
Returns the away team name.
-
#away_team_score ⇒ Integer
Returns the away team score.
-
#away_team_tricode ⇒ String
Returns the away team tricode.
-
#game_clock ⇒ String
Returns the game clock.
-
#game_code ⇒ String
Returns the game code.
-
#game_et ⇒ String
Returns the game time in Eastern Time.
-
#game_id ⇒ String
Returns the game ID.
-
#game_status ⇒ Integer
Returns the game status (1=scheduled, 2=in progress, 3=final).
-
#game_status_text ⇒ String
Returns the game status text.
-
#game_time_utc ⇒ String
Returns the game time in UTC.
-
#home_team_city ⇒ String
Returns the home team city.
-
#home_team_id ⇒ Integer
Returns the home team ID.
-
#home_team_name ⇒ String
Returns the home team name.
-
#home_team_score ⇒ Integer
Returns the home team score.
-
#home_team_tricode ⇒ String
Returns the home team tricode.
-
#period ⇒ Integer
Returns the current period.
Instance Method Summary collapse
-
#away_score ⇒ Integer
Returns the away team score (alias for CLI compatibility).
-
#away_team ⇒ Team?
Returns the away team object.
-
#final? ⇒ Boolean
Returns whether the game is final.
-
#home_score ⇒ Integer
Returns the home team score (alias for CLI compatibility).
-
#home_team ⇒ Team?
Returns the home team object.
-
#in_progress? ⇒ Boolean
Returns whether the game is in progress.
-
#scheduled? ⇒ Boolean
Returns whether the game is scheduled.
-
#status ⇒ String
Returns the game status text (alias for CLI compatibility).
Instance Attribute Details
#away_team_city ⇒ String
Returns the away team city
132 |
# File 'lib/nba/live_game.rb', line 132 attribute :away_team_city, Shale::Type::String |
#away_team_id ⇒ Integer
Returns the away team ID
116 |
# File 'lib/nba/live_game.rb', line 116 attribute :away_team_id, Shale::Type::Integer |
#away_team_name ⇒ String
Returns the away team name
124 |
# File 'lib/nba/live_game.rb', line 124 attribute :away_team_name, Shale::Type::String |
#away_team_score ⇒ Integer
Returns the away team score
148 |
# File 'lib/nba/live_game.rb', line 148 attribute :away_team_score, Shale::Type::Integer |
#away_team_tricode ⇒ String
Returns the away team tricode
140 |
# File 'lib/nba/live_game.rb', line 140 attribute :away_team_tricode, Shale::Type::String |
#game_clock ⇒ String
Returns the game clock
52 |
# File 'lib/nba/live_game.rb', line 52 attribute :game_clock, Shale::Type::String |
#game_code ⇒ String
Returns the game code
20 |
# File 'lib/nba/live_game.rb', line 20 attribute :game_code, Shale::Type::String |
#game_et ⇒ String
Returns the game time in Eastern Time
68 |
# File 'lib/nba/live_game.rb', line 68 attribute :game_et, Shale::Type::String |
#game_id ⇒ String
Returns the game ID
12 |
# File 'lib/nba/live_game.rb', line 12 attribute :game_id, Shale::Type::String |
#game_status ⇒ Integer
Returns the game status (1=scheduled, 2=in progress, 3=final)
28 |
# File 'lib/nba/live_game.rb', line 28 attribute :game_status, Shale::Type::Integer |
#game_status_text ⇒ String
Returns the game status text
36 |
# File 'lib/nba/live_game.rb', line 36 attribute :game_status_text, Shale::Type::String |
#game_time_utc ⇒ String
Returns the game time in UTC
60 |
# File 'lib/nba/live_game.rb', line 60 attribute :game_time_utc, Shale::Type::String |
#home_team_city ⇒ String
Returns the home team city
92 |
# File 'lib/nba/live_game.rb', line 92 attribute :home_team_city, Shale::Type::String |
#home_team_id ⇒ Integer
Returns the home team ID
76 |
# File 'lib/nba/live_game.rb', line 76 attribute :home_team_id, Shale::Type::Integer |
#home_team_name ⇒ String
Returns the home team name
84 |
# File 'lib/nba/live_game.rb', line 84 attribute :home_team_name, Shale::Type::String |
#home_team_score ⇒ Integer
Returns the home team score
108 |
# File 'lib/nba/live_game.rb', line 108 attribute :home_team_score, Shale::Type::Integer |
#home_team_tricode ⇒ String
Returns the home team tricode
100 |
# File 'lib/nba/live_game.rb', line 100 attribute :home_team_tricode, Shale::Type::String |
#period ⇒ Integer
Returns the current period
44 |
# File 'lib/nba/live_game.rb', line 44 attribute :period, Shale::Type::Integer |
Instance Method Details
#away_score ⇒ Integer
Returns the away team score (alias for CLI compatibility)
226 227 228 |
# File 'lib/nba/live_game.rb', line 226 def away_score away_team_score end |
#away_team ⇒ Team?
Returns the away team object
166 167 168 |
# File 'lib/nba/live_game.rb', line 166 def away_team Teams.find(away_team_id) end |
#final? ⇒ Boolean
Returns whether the game is final
196 197 198 |
# File 'lib/nba/live_game.rb', line 196 def final? game_status.eql?(3) end |
#home_score ⇒ Integer
Returns the home team score (alias for CLI compatibility)
216 217 218 |
# File 'lib/nba/live_game.rb', line 216 def home_score home_team_score end |
#home_team ⇒ Team?
Returns the home team object
156 157 158 |
# File 'lib/nba/live_game.rb', line 156 def home_team Teams.find(home_team_id) end |
#in_progress? ⇒ Boolean
Returns whether the game is in progress
186 187 188 |
# File 'lib/nba/live_game.rb', line 186 def in_progress? game_status.eql?(2) end |
#scheduled? ⇒ Boolean
Returns whether the game is scheduled
176 177 178 |
# File 'lib/nba/live_game.rb', line 176 def scheduled? game_status.eql?(1) end |
#status ⇒ String
Returns the game status text (alias for CLI compatibility)
206 207 208 |
# File 'lib/nba/live_game.rb', line 206 def status game_status_text end |