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