class FlexYear::Historical
Represents a flexible year entry that must be in the past.
Private Instance Methods
parse_year(year_string)
click to toggle source
Calls superclass method
FlexYear#parse_year
# File lib/flexyear.rb, line 153 def parse_year(year_string) super(year_string) if (!@year_low.nil? && @year_low > DateTime.now.year) || (!@year_high.nil? && @year_high > DateTime.now.year) raise InvalidYearError, "The year must be in the past. You specified #{year_string}; Today is #{DateTime.now.year}" end end