Class: Delayed::PerformableMailer
- Inherits:
-
PerformableMethod
- Object
- PerformableMethod
- Delayed::PerformableMailer
- Defined in:
- lib/delayed/shallow_mongoid/performable_mailer.rb
Instance Attribute Summary
Attributes inherited from PerformableMethod
Instance Method Summary collapse
Methods inherited from PerformableMethod
Constructor Details
This class inherits a constructor from Delayed::PerformableMethod
Instance Method Details
#perform ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'lib/delayed/shallow_mongoid/performable_mailer.rb', line 3 def perform klass = ShallowMongoid.load(object) delayed_arguments = *args.map { |a| ShallowMongoid.load(a) } = klass.send(method_name, *delayed_arguments) .respond_to?(:deliver_now) ? .deliver_now : .deliver rescue Delayed::ShallowMongoid::Errors::DocumentNotFound return true # do nothing if document has been removed end |