merged cont.
[opensuse:yast-rest-service.git] / webyast / vendor / plugins / delayed_job / lib / delayed / message_sending.rb
1 module Delayed
2   module MessageSending
3     def send_later(method, *args)
4       Delayed::Job.enqueue Delayed::PerformableMethod.new(self, method.to_sym, args)
5     end
6     
7     module ClassMethods
8       def handle_asynchronously(method)
9         without_name = "#{method}_without_send_later"
10         define_method("#{method}_with_send_later") do |*args|
11           send_later(without_name, *args)
12         end
13         alias_method_chain method, :send_later
14       end
15     end
16   end                               
17 end