class DelayedFu::DelayedMethod

Public Class Methods

new(target) click to toggle source
# File lib/delayed_fu.rb, line 10
def initialize(target)
  @target = target
end

Public Instance Methods

method_missing(method_name, *args, &block) click to toggle source
# File lib/delayed_fu.rb, line 18
def method_missing(method_name, *args, &block)
  raise NoMethodError.new("undefined method `#{method_name}' for #{@target.inspect}") unless respond_to?(method_name, *args, &block)
  if @target.class == Class && defined?(Job)
    Job.enqueue!(@target.to_s, "class.#{method_name}", *args)
  else
    Job.enqueue!(@target.class.to_s, method_name.to_s, *args)
  end
end
respond_to?(method_name, *args, &block) click to toggle source
# File lib/delayed_fu.rb, line 14
def respond_to?(method_name, *args, &block)
  @target.respond_to?(method_name)
end