Class: Delayed::DelayProxy

Inherits:
ActiveSupport::BasicObject
Defined in:
lib/delayed/message_sending.rb

Instance Method Summary collapse

Constructor Details

#initialize(target, options) ⇒ DelayProxy

Returns a new instance of DelayProxy.



3
4
5
6
# File 'lib/delayed/message_sending.rb', line 3

def initialize(target, options)
  @target = target
  @options = options
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/delayed/message_sending.rb', line 8

def method_missing(method, *args)
  Job.create({
    :payload_object => PerformableMethod.new(@target, method.to_sym, args),
    :priority       => ::Delayed::Worker.default_priority,
    :queue          => ::Delayed::Worker.default_queue
  }.merge(@options))
end