class Chronic::Season
def self.find_next_season(season, pointer)
-
(Symbol)
- The new season name
Parameters:
-
pointer
(Integer
) -- The direction (-1 for past, 1 for future) -
season
(Symbol
) -- The season name
def self.find_next_season(season, pointer) lookup = {:spring => 0, :summer => 1, :autumn => 2, :winter => 3} next_season_num = (lookup[season] + 1 * pointer) % 4 lookup.invert[next_season_num] end
def self.season_after(season)
-
(Symbol)
- The new season name
Parameters:
-
season
(Symbol
) -- The season name
def self.season_after(season) find_next_season(season, +1) end
def self.season_before(season)
-
(Symbol)
- The new season name
Parameters:
-
season
(Symbol
) -- The season name
def self.season_before(season) find_next_season(season, -1) end
def initialize(start_date, end_date)
-
end_date
(MiniDate
) -- -
start_date
(MiniDate
) --
def initialize(start_date, end_date) @start = start_date @end = end_date end