Sha256: 3fd7998e9936b2e56302451727d4fc9d6ca8badba24d8a5ffd83bbe09f026734

Contents?: true

Size: 490 Bytes

Versions: 27

Compression:

Stored size: 490 Bytes

Contents

require 'mail'

module Delayed
  class PerformableMailer < PerformableMethod
    def perform
      mailer = object.send(method_name, *args)
      mailer.respond_to?(:deliver_now) ? mailer.deliver_now : mailer.deliver
    end
  end

  module DelayMail
    def delay(options = {})
      DelayProxy.new(PerformableMailer, self, options)
    end
  end
end

Mail::Message.class_eval do
  def delay(*_args)
    raise 'Use MyMailer.delay.mailer_action(args) to delay sending of emails.'
  end
end

Version data entries

27 entries across 27 versions & 4 rubygems

Version Path
delayed_job-4.1.13 lib/delayed/performable_mailer.rb
delayed_job-4.1.12 lib/delayed/performable_mailer.rb
delayed_job-4.1.12.rc1 lib/delayed/performable_mailer.rb
delayed_job-4.1.11 lib/delayed/performable_mailer.rb
delayed_job-4.1.10 lib/delayed/performable_mailer.rb
delayed-0.3.0 lib/delayed/performable_mailer.rb
delayed-0.2.0 lib/delayed/performable_mailer.rb
delayed-0.1.1 lib/delayed/performable_mailer.rb
delayed-0.1.0 lib/delayed/performable_mailer.rb
delayed_job-4.1.9 lib/delayed/performable_mailer.rb
delayed_job-4.1.8 lib/delayed/performable_mailer.rb
delayed_job-4.1.8.beta1 lib/delayed/performable_mailer.rb
delayed_job-4.1.7 lib/delayed/performable_mailer.rb
delayed_job-4.1.7.beta1 lib/delayed/performable_mailer.rb
delayed_job-4.1.6 lib/delayed/performable_mailer.rb
delayed_job-4.1.6.beta1 lib/delayed/performable_mailer.rb
delayed_job-4.1.5 lib/delayed/performable_mailer.rb
delayed_job-4.1.4 lib/delayed/performable_mailer.rb
delayed_job-4.1.3 lib/delayed/performable_mailer.rb
delayed_job-4.1.2 lib/delayed/performable_mailer.rb