Class: Resque::MailQueue::EnqueueProxy
- Inherits:
-
Object
- Object
- Resque::MailQueue::EnqueueProxy
- Defined in:
- lib/resque_mail_queue.rb
Instance Method Summary collapse
-
#initialize(klass, queue, options = {}) ⇒ EnqueueProxy
constructor
A new instance of EnqueueProxy.
- #method_missing(method, *args, &block) ⇒ Object
Constructor Details
#initialize(klass, queue, options = {}) ⇒ EnqueueProxy
Returns a new instance of EnqueueProxy.
30 31 32 33 34 |
# File 'lib/resque_mail_queue.rb', line 30 def initialize(klass, queue, = {}) @klass = klass @queue = queue @options = end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/resque_mail_queue.rb', line 36 def method_missing(method, *args, &block) if @klass.respond_to? method @options.merge!({'klass' => @klass.to_s, 'method' => method, 'args' => args}) if @queue Resque.enqueue_to(@queue, @klass, @options) else Resque.enqueue(@klass, @options) end else super end end |