Class: CrontabMonth

Inherits:
AbstractCrontabField show all
Defined in:
lib/crontab_fields.rb

Constant Summary collapse

@@min =
1
@@max =
12

Instance Method Summary collapse

Methods inherited from AbstractCrontabField

create_from_string, #to_s

Constructor Details

#initialize(start, stop = nil, step = nil) ⇒ CrontabMonth

Returns a new instance of CrontabMonth.



85
86
87
88
89
# File 'lib/crontab_fields.rb', line 85

def initialize(start, stop=nil, step=nil)
  super(start, stop, step)
  raise "Month field #{@start} must not be greater than #{@@min}" if @start < @@min
  raise "Month field #{@stop} must not be greater than #{@@max}" if @stop > @@max
end