class Cronline::CronYears

Public Class Methods

absolute_max_year() click to toggle source
# File lib/cronline/cron_years.rb, line 8
def self.absolute_max_year
  2099
end
absolute_min_year() click to toggle source
# File lib/cronline/cron_years.rb, line 4
def self.absolute_min_year
  1970
end
new(cron_expression) click to toggle source
Calls superclass method Cronline::CronField::new
# File lib/cronline/cron_years.rb, line 12
def initialize(cron_expression)
  expression = cron_expression.split(' ')[6]
  if expression.nil?
    super(CronField.wildcard, CronYears.absolute_min_year , CronYears.absolute_max_year)
  else
    super(expression, CronYears.absolute_min_year , CronYears.absolute_max_year)
  end
end

Public Instance Methods

time_field(time) click to toggle source
# File lib/cronline/cron_years.rb, line 21
def time_field(time)
  time.year
end