Class: SayWhen::Triggers::InstanceStrategy
- Inherits:
-
Object
- Object
- SayWhen::Triggers::InstanceStrategy
- Includes:
- Base
- Defined in:
- lib/say_when/triggers/instance_strategy.rb
Instance Attribute Summary collapse
-
#instance ⇒ Object
Returns the value of attribute instance.
-
#next_at_method ⇒ Object
Returns the value of attribute next_at_method.
Attributes included from Base
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ InstanceStrategy
constructor
A new instance of InstanceStrategy.
- #next_fire_at(time = Time.now) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ InstanceStrategy
Returns a new instance of InstanceStrategy.
12 13 14 15 16 |
# File 'lib/say_when/triggers/instance_strategy.rb', line 12 def initialize( = {}) super self.instance = job.scheduled self.next_at_method = [:next_at_method] || 'next_fire_at' end |
Instance Attribute Details
#instance ⇒ Object
Returns the value of attribute instance.
10 11 12 |
# File 'lib/say_when/triggers/instance_strategy.rb', line 10 def instance @instance end |
#next_at_method ⇒ Object
Returns the value of attribute next_at_method.
10 11 12 |
# File 'lib/say_when/triggers/instance_strategy.rb', line 10 def next_at_method @next_at_method end |
Instance Method Details
#next_fire_at(time = Time.now) ⇒ Object
18 19 20 |
# File 'lib/say_when/triggers/instance_strategy.rb', line 18 def next_fire_at(time = Time.now) instance.send(next_at_method, time) end |