Class: CrontabHour

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

Constant Summary collapse

@@min =
0
@@max =
23

Instance Method Summary collapse

Methods inherited from AbstractCrontabField

create_from_string, #to_s

Constructor Details

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

Returns a new instance of CrontabHour.



65
66
67
68
69
# File 'lib/crontab_fields.rb', line 65

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