Class: CronSpec::MonthFactory
- Inherits:
-
CronSpecificationFactory
- Object
- CronSpecificationFactory
- CronSpec::MonthFactory
- Defined in:
- lib/cron-spec/month_factory.rb
Overview
Factory for constructing month cron values from a cron specification.
Constant Summary collapse
- MonthLowerLimit =
The lower limit for a value representing a month of a year
1
- MonthUpperLimit =
The upper limit for a value representing a month of a year
12
- Months =
The supported names of the months
%w{ jan feb mar apr may jun jul aug sep oct nov dec }
- MonthExpression =
A pipe-delimited list of the months of the year
Months.join('|')
- MonthSingleValuePattern =
A regular expression to match a single value month expression
/\A(#{MonthExpression}|\d+)\z/
- MonthRangePattern =
A regular expression to match a range month expression
/\A(#{MonthExpression}|\d+)-(#{MonthExpression}|\d+)\z/
- NamedMonthPattern =
A regular expression to match a named month
/\A(#{MonthExpression})\z/
Constants inherited from CronSpecificationFactory
CronSpecificationFactory::RangePattern, CronSpecificationFactory::SingleValuePattern, CronSpecificationFactory::StepPattern, CronSpecificationFactory::WildcardPattern
Instance Method Summary collapse
-
#initialize ⇒ MonthFactory
constructor
Constructs a new MonthFactory object.
Methods inherited from CronSpecificationFactory
Constructor Details
#initialize ⇒ MonthFactory
Constructs a new MonthFactory object.
31 32 33 34 35 36 37 |
# File 'lib/cron-spec/month_factory.rb', line 31 def initialize super @lower_limit = MonthLowerLimit @upper_limit = MonthUpperLimit @single_value_pattern = MonthSingleValuePattern @range_pattern = MonthRangePattern end |