Class: SuckerPunch::Backgroundable::BackgroundProxy Private
- Inherits:
-
Object
- Object
- SuckerPunch::Backgroundable::BackgroundProxy
- Defined in:
- lib/sucker_punch/backgroundable/backgroundable.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
-
#initialize(receiver, options, seconds = 0) ⇒ BackgroundProxy
constructor
private
A new instance of BackgroundProxy.
- #method_missing(method, *args, &block) ⇒ Object private
Constructor Details
#initialize(receiver, options, seconds = 0) ⇒ BackgroundProxy
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of BackgroundProxy.
137 138 139 140 141 |
# File 'lib/sucker_punch/backgroundable/backgroundable.rb', line 137 def initialize(receiver, , seconds = 0) @receiver = receiver @options = @seconds = seconds end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
143 144 145 146 147 |
# File 'lib/sucker_punch/backgroundable/backgroundable.rb', line 143 def method_missing(method, *args, &block) @receiver.method_missing(method, *args, &block) unless @receiver.respond_to?(method) raise ArgumentError.new("Backgrounding a method with a block argument is not supported.") if block_given? JobRunner.new(@receiver, method, args, @options).run(@seconds) end |