Skip to content

Commit

Permalink
Alias #delay to #__delay__ so it can still be called if #delay is ove…
Browse files Browse the repository at this point in the history
…rridden
  • Loading branch information
bkeepers committed May 21, 2010
1 parent 92c1e49 commit 4a4de1f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/delayed/message_sending.rb
Expand Up @@ -18,15 +18,16 @@ module MessageSending
def delay(options = {})
DelayProxy.new(self, options)
end
alias __delay__ delay

def send_later(method, *args)
warn "[DEPRECATION] `object.send_later(:method)` is deprecated. Use `object.delay.method"
delay.__send__(method, *args)
__delay__.__send__(method, *args)
end

def send_at(time, method, *args)
warn "[DEPRECATION] `object.send_at(time, :method)` is deprecated. Use `object.delay(:run_at => time).method"
delay(:run_at => time).__send__(method, *args)
__delay__(:run_at => time).__send__(method, *args)
end

module ClassMethods
Expand Down

0 comments on commit 4a4de1f

Please sign in to comment.