Parent

Delayed::PerformableMethod

Public Class Methods

new(object, method, args) click to toggle source
# File lib/delayed/performable_method.rb, line 6
def initialize(object, method, args)
  raise NoMethodError, "undefined method `#{method}' for #{self.inspect}" unless object.respond_to?(method)

  self.object = dump(object)
  self.args   = args.map { |a| dump(a) }
  self.method = method.to_sym
end

Public Instance Methods

display_name() click to toggle source
# File lib/delayed/performable_method.rb, line 14
def display_name  
  case self.object
  when CLASS_STRING_FORMAT then "#{$1}.#{method}"
  when AR_STRING_FORMAT    then "#{$1}##{method}"
  else "Unknown##{method}"
  end      
end
perform() click to toggle source
# File lib/delayed/performable_method.rb, line 22
def perform
  load(object).send(method, *args.map{|a| load(a)})
rescue ActiveRecord::RecordNotFound
  # We cannot do anything about objects which were deleted in the meantime
  true
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.