Module: SayWhen::Triggers::Base

Included in:
CronStrategy, InstanceStrategy, OnceStrategy
Defined in:
lib/say_when/triggers/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#jobObject

Returns the value of attribute job.



6
7
8
# File 'lib/say_when/triggers/base.rb', line 6

def job
  @job
end

Instance Method Details

#initialize(options = {}) ⇒ Object

Raises:

  • (ArgumentError)


8
9
10
11
# File 'lib/say_when/triggers/base.rb', line 8

def initialize(options = {})
  self.job = options.delete(:job)
  raise ArgumentError.new("job must be provided to create a trigger") unless job
end

#next_fire_at(time = nil) ⇒ Object

Raises:

  • (NotImplementedError)


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

def next_fire_at(time = nil)
  raise NotImplementedError.new('You need to implement next_fire_at in your strategy')
end