Module: Resque::MailQueue

Extended by:
MailQueue
Includes:
Helpers
Included in:
ActionMailer::Base, MailQueue
Defined in:
lib/resque_mail_queue.rb

Defined Under Namespace

Classes: EnqueueProxy

Constant Summary collapse

VERSION =
'0.4.0'

Instance Method Summary collapse

Instance Method Details

#enqueue(options = {}) ⇒ Object


20
21
22
# File 'lib/resque_mail_queue.rb', line 20

def enqueue(options = {})
  enqueue_to(nil, options)
end

#enqueue_to(queue, options = {}) ⇒ Object


24
25
26
# File 'lib/resque_mail_queue.rb', line 24

def enqueue_to(queue, options = {})
  EnqueueProxy.new(self, queue, options)
end

#perform(options = {}) ⇒ Object


14
15
16
17
18
# File 'lib/resque_mail_queue.rb', line 14

def perform(options = {})
  mailer = constantize(options['klass'])
  method = options['method']
  mailer.send(method, *options['args']).deliver
end

#queueObject


10
11
12
# File 'lib/resque_mail_queue.rb', line 10

def queue
  :mail
end