Class: MLB::GameType
- Inherits:
-
IdDescriptionType
- Object
- Shale::Mapper
- IdDescriptionType
- MLB::GameType
- Defined in:
- lib/mlb/game_type.rb
Overview
Represents a game type (e.g., Regular Season, Postseason, Spring Training)
Constant Summary collapse
- TYPE_REGULAR =
Game type: Regular Season
"R".freeze
- TYPE_SPRING =
Game type: Spring Training
"S".freeze
- TYPE_EXHIBITION =
Game type: Exhibition
"E".freeze
- TYPE_ALL_STAR =
Game type: All-Star Game
"A".freeze
- TYPE_WILD_CARD =
Game type: Wild Card
"F".freeze
- TYPE_DIVISION =
Game type: Division Series
"D".freeze
- TYPE_LCS =
Game type: League Championship Series
"L".freeze
- TYPE_WORLD_SERIES =
Game type: World Series
"W".freeze
- POSTSEASON_TYPES =
Game type codes that indicate postseason games
%w[F D L W].freeze
Instance Attribute Summary
Attributes inherited from IdDescriptionType
Instance Method Summary collapse
-
#all_star? ⇒ Boolean
Returns whether this is an All-Star game type.
-
#division_series? ⇒ Boolean
Returns whether this is a Division Series game type.
-
#exhibition? ⇒ Boolean
Returns whether this is an exhibition game type.
-
#lcs? ⇒ Boolean
Returns whether this is a League Championship Series game type.
-
#postseason? ⇒ Boolean
Returns whether this is a postseason game type.
-
#regular_season? ⇒ Boolean
Returns whether this is a regular season game type.
-
#spring_training? ⇒ Boolean
Returns whether this is a spring training game type.
-
#wild_card? ⇒ Boolean
Returns whether this is a Wild Card game type.
-
#world_series? ⇒ Boolean
Returns whether this is a World Series game type.
Methods inherited from IdDescriptionType
Instance Method Details
#all_star? ⇒ Boolean
Returns whether this is an All-Star game type
55 |
# File 'lib/mlb/game_type.rb', line 55 def all_star? = id.eql?(TYPE_ALL_STAR) |
#division_series? ⇒ Boolean
Returns whether this is a Division Series game type
71 |
# File 'lib/mlb/game_type.rb', line 71 def division_series? = id.eql?(TYPE_DIVISION) |
#exhibition? ⇒ Boolean
Returns whether this is an exhibition game type
47 |
# File 'lib/mlb/game_type.rb', line 47 def exhibition? = id.eql?(TYPE_EXHIBITION) |
#lcs? ⇒ Boolean
Returns whether this is a League Championship Series game type
79 |
# File 'lib/mlb/game_type.rb', line 79 def lcs? = id.eql?(TYPE_LCS) |
#postseason? ⇒ Boolean
Returns whether this is a postseason game type
mutant:disable - .to_s is for type safety; include?(nil) returns false anyway
96 |
# File 'lib/mlb/game_type.rb', line 96 def postseason? = POSTSEASON_TYPES.include?(id.to_s) |
#regular_season? ⇒ Boolean
Returns whether this is a regular season game type
31 |
# File 'lib/mlb/game_type.rb', line 31 def regular_season? = id.eql?(TYPE_REGULAR) |
#spring_training? ⇒ Boolean
Returns whether this is a spring training game type
39 |
# File 'lib/mlb/game_type.rb', line 39 def spring_training? = id.eql?(TYPE_SPRING) |
#wild_card? ⇒ Boolean
Returns whether this is a Wild Card game type
63 |
# File 'lib/mlb/game_type.rb', line 63 def wild_card? = id.eql?(TYPE_WILD_CARD) |
#world_series? ⇒ Boolean
Returns whether this is a World Series game type
87 |
# File 'lib/mlb/game_type.rb', line 87 def world_series? = id.eql?(TYPE_WORLD_SERIES) |