Class: Delayed::DelayProxy
- Inherits:
- BasicObject
- Defined in:
- lib/delayed/message_sending.rb
Instance Method Summary collapse
-
#initialize(payload_class, target, options) ⇒ DelayProxy
constructor
A new instance of DelayProxy.
-
#method_missing(method, *args) ⇒ Object
rubocop:disable MethodMissing.
-
#raise(*args) ⇒ Object
Let DelayProxy raise exceptions.
Constructor Details
#initialize(payload_class, target, options) ⇒ DelayProxy
Returns a new instance of DelayProxy.
13 14 15 16 17 |
# File 'lib/delayed/message_sending.rb', line 13 def initialize(payload_class, target, ) @payload_class = payload_class @target = target @options = end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
rubocop:disable MethodMissing
20 21 22 |
# File 'lib/delayed/message_sending.rb', line 20 def method_missing(method, *args) Job.enqueue({:payload_object => @payload_class.new(@target, method.to_sym, args)}.merge(@options)) end |
Instance Method Details
#raise(*args) ⇒ Object
Let DelayProxy raise exceptions.
9 10 11 |
# File 'lib/delayed/message_sending.rb', line 9 def raise(*args) ::Object.send(:raise, *args) end |