Class: Cronline::CronHours

Inherits:
CronField show all
Defined in:
lib/cronline/cron_hours.rb

Instance Method Summary collapse

Methods inherited from CronField

#range, #test?, wildcard

Constructor Details

#initialize(cron_expression) ⇒ CronHours

Returns a new instance of CronHours.



3
4
5
6
# File 'lib/cronline/cron_hours.rb', line 3

def initialize(cron_expression)
  expression = cron_expression.split(' ')[2]
  super(expression, 0, 23)
end

Instance Method Details

#time_field(time) ⇒ Object



8
9
10
# File 'lib/cronline/cron_hours.rb', line 8

def time_field(time)
  time.hour
end