class Sidekiq::Later::MethodMixin::MethodProxy

Attributes

inline[RW]
target[RW]

Public Class Methods

new(target, inline = false) click to toggle source
# File lib/sidekiq/later/method_mixin.rb, line 7
def initialize(target, inline = false)
  @target = target
  @inline = inline
end

Public Instance Methods

method_missing(name, *args, &block) click to toggle source
Calls superclass method
# File lib/sidekiq/later/method_mixin.rb, line 12
def method_missing(name, *args, &block)
  super unless target.respond_to?(name)

  worker_args = [target.class.to_s, target.id, name, *args]

  if inline
    Worker.new.perform *worker_args
  else
    Worker.perform_async *worker_args
  end
end
respond_to_missing?(name, include_private = false) click to toggle source
# File lib/sidekiq/later/method_mixin.rb, line 24
def respond_to_missing?(name, include_private = false)
  target_class.new.respond_to?(name)
end