Class: MLB::League
- Inherits:
-
Shale::Mapper
- Object
- Shale::Mapper
- MLB::League
- Includes:
- Comparable, ComparableByAttribute
- Defined in:
- lib/mlb/league.rb
Overview
Represents a league (e.g., American League, National League)
Constant Summary collapse
- SEASON_PRESEASON =
"preseason".freeze
- SEASON_INSEASON =
"inseason".freeze
- SEASON_POSTSEASON =
"postseason".freeze
- SEASON_OFFSEASON =
"offseason".freeze
Instance Method Summary collapse
-
#active? ⇒ Boolean
Checks if the league is active.
-
#comparable_attribute ⇒ Symbol
private
Returns the attribute used for sorting.
-
#conferences? ⇒ Boolean
Checks if the league uses conferences.
-
#divisions? ⇒ Boolean
Checks if the league uses divisions.
-
#in_season? ⇒ Boolean
Checks if the league is in season.
-
#offseason? ⇒ Boolean
Checks if the league is in offseason.
-
#playoff_points? ⇒ Boolean
Checks if the league uses playoff points.
-
#postseason? ⇒ Boolean
Checks if the league is in postseason.
-
#preseason? ⇒ Boolean
Checks if the league is in preseason.
-
#split_season? ⇒ Boolean
Checks if the league has a split season.
-
#wildcard? ⇒ Boolean
Checks if the league has a wildcard.
Methods included from ComparableByAttribute
Instance Method Details
#active? ⇒ Boolean
Checks if the league is active
52 |
# File 'lib/mlb/league.rb', line 52 def active? = active |
#comparable_attribute ⇒ Symbol
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the attribute used for sorting
23 |
# File 'lib/mlb/league.rb', line 23 def comparable_attribute = :sort_order |
#conferences? ⇒ Boolean
Checks if the league uses conferences
84 |
# File 'lib/mlb/league.rb', line 84 def conferences? = conferences_in_use |
#divisions? ⇒ Boolean
Checks if the league uses divisions
92 |
# File 'lib/mlb/league.rb', line 92 def divisions? = divisions_in_use |
#in_season? ⇒ Boolean
Checks if the league is in season
108 |
# File 'lib/mlb/league.rb', line 108 def in_season? = season_state.eql?(SEASON_INSEASON) |
#offseason? ⇒ Boolean
Checks if the league is in offseason
124 |
# File 'lib/mlb/league.rb', line 124 def offseason? = season_state.eql?(SEASON_OFFSEASON) |
#playoff_points? ⇒ Boolean
Checks if the league uses playoff points
76 |
# File 'lib/mlb/league.rb', line 76 def playoff_points? = has_playoff_points |
#postseason? ⇒ Boolean
Checks if the league is in postseason
116 |
# File 'lib/mlb/league.rb', line 116 def postseason? = season_state.eql?(SEASON_POSTSEASON) |
#preseason? ⇒ Boolean
Checks if the league is in preseason
100 |
# File 'lib/mlb/league.rb', line 100 def preseason? = season_state.eql?(SEASON_PRESEASON) |
#split_season? ⇒ Boolean
Checks if the league has a split season
68 |
# File 'lib/mlb/league.rb', line 68 def split_season? = has_split_season |
#wildcard? ⇒ Boolean
Checks if the league has a wildcard
60 |
# File 'lib/mlb/league.rb', line 60 def wildcard? = has_wildcard |