module Procrastinator::Task

Module to be included by user-defined task classes. It provides some extra error checking and a convenient way for the task class to access additional information (data, logger, etc) from Procrastinator.

If you are averse to including this in your task class, you can just declare an attr_accessor for the information you want Procrastinator to feed your task.

@author Robin Miller

Constants

KNOWN_ATTRIBUTES

Public Class Methods

included(base) click to toggle source
# File lib/procrastinator/task.rb, line 14
def self.included(base)
   base.extend(TaskClassMethods)
end

Public Instance Methods

method_missing(method_name, *args, &block) click to toggle source
Calls superclass method
# File lib/procrastinator/task.rb, line 22
def method_missing(method_name, *args, &block)
   if KNOWN_ATTRIBUTES.include?(method_name)
      raise NameError, "To access Procrastinator::Task attribute :#{ method_name }, " \
                       "call task_attr(:#{ method_name }) in your class definition."
   end

   super
end
respond_to_missing?(name, include_private) click to toggle source
Calls superclass method
# File lib/procrastinator/task.rb, line 18
def respond_to_missing?(name, include_private)
   super
end