Class: SayWhen::Triggers::CronStrategy

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/say_when/triggers/cron_strategy.rb

Instance Attribute Summary collapse

Attributes included from Base

#job

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ CronStrategy

Returns a new instance of CronStrategy.



13
14
15
16
# File 'lib/say_when/triggers/cron_strategy.rb', line 13

def initialize(options = {})
  super
  self.cron_expression = SayWhen::CronExpression.new(options)
end

Instance Attribute Details

#cron_expressionObject

Returns the value of attribute cron_expression.



11
12
13
# File 'lib/say_when/triggers/cron_strategy.rb', line 11

def cron_expression
  @cron_expression
end

Instance Method Details

#next_fire_at(time = nil) ⇒ Object



18
19
20
# File 'lib/say_when/triggers/cron_strategy.rb', line 18

def next_fire_at(time = nil)
  cron_expression.next_fire_at(time || Time.now)
end