Class: CronSpec::DowFactory

Inherits:
CronSpecificationFactory show all
Defined in:
lib/cron-spec/dow_factory.rb

Overview

Factory for constructing Day of week values from a cron specification.

Constant Summary collapse

DayOfWeekLowerLimit =

The lower limit for the value of a day of the week (0-Sunday)

0
DayOfWeekUpperLimit =

The upper limit for the value of a day of the week (6-Saturday)

6
DaysOfWeek =

The supported names for the days of the week

%w{ sun mon tue wed thu fri sat }
DayOfWeekExpression =

A pipe-delimited expression for the days of the week

DaysOfWeek.join('|')
DayOfWeekSingleValuePattern =

A regular expression that matches a single day of the week.

/\A(#{DayOfWeekExpression}|\d)\z/
DayOfWeekRangePattern =

Regular expression that matches a range of days of the week

/\A(#{DayOfWeekExpression}|\d)-(#{DayOfWeekExpression}|\d)\z/
NamedDayOfWeekPattern =

Regular expression that matches only a named day of the week.

/\A(#{DayOfWeekExpression})\z/

Constants inherited from CronSpecificationFactory

CronSpecificationFactory::RangePattern, CronSpecificationFactory::SingleValuePattern, CronSpecificationFactory::StepPattern, CronSpecificationFactory::WildcardPattern

Instance Method Summary collapse

Methods inherited from CronSpecificationFactory

#parse

Constructor Details

#initializeDowFactory

Constructs a new DowFactory object.



31
32
33
34
35
36
37
# File 'lib/cron-spec/dow_factory.rb', line 31

def initialize
  super
  @lower_limit = DayOfWeekLowerLimit
  @upper_limit = DayOfWeekUpperLimit
  @single_value_pattern = DayOfWeekSingleValuePattern
  @range_pattern = DayOfWeekRangePattern
end