Class: Qu::Delayed::Payload
- Inherits:
-
Payload
- Object
- Payload
- Qu::Delayed::Payload
- Defined in:
- lib/qu/delayed/payload.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Payload
constructor
A new instance of Payload.
- #perform ⇒ Object
- #to_s ⇒ Object
- #undelay ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Payload
Returns a new instance of Payload.
7 8 9 10 11 12 |
# File 'lib/qu/delayed/payload.rb', line 7 def initialize( = {}) super unless _id.nil? self.run_at ||= _id.generation_time end end |
Instance Method Details
#perform ⇒ Object
14 15 16 |
# File 'lib/qu/delayed/payload.rb', line 14 def perform Qu.enqueue(klass, args) end |
#to_s ⇒ Object
18 19 20 |
# File 'lib/qu/delayed/payload.rb', line 18 def to_s "#{run_at.to_i}:#{super}" end |