Class: SayWhen::Triggers::CronStrategy
- Inherits:
-
Object
- Object
- SayWhen::Triggers::CronStrategy
- Includes:
- Base
- Defined in:
- lib/say_when/triggers/cron_strategy.rb
Instance Attribute Summary collapse
-
#cron_expression ⇒ Object
Returns the value of attribute cron_expression.
Attributes included from Base
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ CronStrategy
constructor
A new instance of CronStrategy.
- #next_fire_at(time = nil) ⇒ Object
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( = {}) super self.cron_expression = SayWhen::CronExpression.new() end |
Instance Attribute Details
#cron_expression ⇒ Object
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 |