Module: CronCalc

Defined in:
lib/cron_calc.rb,
lib/cron_calc/version.rb

Overview

The CronCalc is gem-wrapper module for the Parser class

Defined Under Namespace

Classes: Error, Parser

Constant Summary collapse

RANGE =
{
  minutes: 0..59,
  hours: 0..23,
  days: 1..31,
  months: 1..12,
  wdays: 0..6
}.freeze
WDAYS =
{
  'SUN' => '0', 'MON' => '1', 'TUE' => '2', 'WED' => '3',
  'THU' => '4', 'FRI' => '5', 'SAT' => '6'
}.freeze
MONTHS =
{
  'JAN' => '1', 'FEB' => '2', 'MAR' => '3', 'APR' => '4',
  'MAY' => '5', 'JUN' => '6', 'JUL' => '7', 'AUG' => '8',
  'SEP' => '9', 'OCT' => '10', 'NOV' => '11', 'DEC' => '12'
}.freeze
PREDEFINED_DEFINITIONS =
{
  '@yearly' => '0 0 1 1 *', '@annually' => '0 0 1 1 *',
  '@monthly' => '0 0 1 * *',
  '@weekly' => '0 0 * * 0',
  '@daily' => '0 0 * * *', '@midnight' => '0 0 * * *',
  '@hourly' => '0 * * * *'
}.freeze
VERSION =
'1.0.0'

Class Method Summary collapse

Class Method Details

.new(cron_string) ⇒ Object



37
38
39
# File 'lib/cron_calc.rb', line 37

def self.new(cron_string)
  Parser.new(cron_string)
end