Class: MLB::GameStatus
- Inherits:
-
Shale::Mapper
- Object
- Shale::Mapper
- MLB::GameStatus
- Defined in:
- lib/mlb/game_status.rb
Overview
Represents a game status
Constant Summary collapse
- FINAL =
"Final".freeze
- LIVE =
"Live".freeze
- PREVIEW =
"Preview".freeze
Instance Attribute Summary collapse
-
#abstract_game_code ⇒ String
Returns the abstract game code.
-
#abstract_game_state ⇒ String
Returns the high-level game state.
-
#coded_game_state ⇒ String
Returns the coded game state.
-
#detailed_state ⇒ String
Returns the detailed game state.
-
#reason ⇒ String
Returns the reason for the status.
-
#status_code ⇒ String
Returns the status code.
Instance Method Summary collapse
-
#final? ⇒ Boolean
Returns whether the game is final (completed).
-
#live? ⇒ Boolean
Returns whether the game is live (in progress).
-
#preview? ⇒ Boolean
Returns whether the game is in preview (not yet started).
Instance Attribute Details
#abstract_game_code ⇒ String
Returns the abstract game code
51 |
# File 'lib/mlb/game_status.rb', line 51 attribute :abstract_game_code, Shale::Type::String |
#abstract_game_state ⇒ String
Returns the high-level game state
19 |
# File 'lib/mlb/game_status.rb', line 19 attribute :abstract_game_state, Shale::Type::String |
#coded_game_state ⇒ String
Returns the coded game state
27 |
# File 'lib/mlb/game_status.rb', line 27 attribute :coded_game_state, Shale::Type::String |
#detailed_state ⇒ String
Returns the detailed game state
35 |
# File 'lib/mlb/game_status.rb', line 35 attribute :detailed_state, Shale::Type::String |
#reason ⇒ String
Returns the reason for the status
59 |
# File 'lib/mlb/game_status.rb', line 59 attribute :reason, Shale::Type::String |
#status_code ⇒ String
Returns the status code
43 |
# File 'lib/mlb/game_status.rb', line 43 attribute :status_code, Shale::Type::String |
Instance Method Details
#final? ⇒ Boolean
Returns whether the game is final (completed)
67 |
# File 'lib/mlb/game_status.rb', line 67 def final? = abstract_game_state.eql?(FINAL) |
#live? ⇒ Boolean
Returns whether the game is live (in progress)
75 |
# File 'lib/mlb/game_status.rb', line 75 def live? = abstract_game_state.eql?(LIVE) |
#preview? ⇒ Boolean
Returns whether the game is in preview (not yet started)
83 |
# File 'lib/mlb/game_status.rb', line 83 def preview? = abstract_game_state.eql?(PREVIEW) |