Class: CronFormat

Inherits:
Object
  • Object
show all
Defined in:
lib/cron_format.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cron_string, now = Time.now) ⇒ CronFormat

Returns a new instance of CronFormat.



20
21
22
23
# File 'lib/cron_format.rb', line 20

def initialize(cron_string, now=Time.now)  
  @cron_string, @to_time = cron_string, now
  parse()
end

Instance Attribute Details

#to_expressionObject (readonly)

Returns the value of attribute to_expression.



18
19
20
# File 'lib/cron_format.rb', line 18

def to_expression
  @to_expression
end

#to_timeObject (readonly)

Returns the value of attribute to_time.



18
19
20
# File 'lib/cron_format.rb', line 18

def to_time
  @to_time
end

Instance Method Details

#nextObject



25
26
27
28
29
30
# File 'lib/cron_format.rb', line 25

def next()
  
  nudge() #unless @cron_string =~ %r{/}
  #puts ':to_time : ' + @to_time.inspect
  parse()
end