bvandenbos/resque-scheduler — pull request #216 by andreacfm (2013-04-18 10:51:57+00:00)
Title: Add 2 methods:

* Resque.delayed? MyJob => Boolean
* Resque.next_delayed_schedule MyJob => timestamp

``` ruby
# Discover if a job hs been delayed.
# Examples
# Resque.delayed? MyJob
# Resque.delayed? MyJob, id: 1
#
# Returns true if the job has been delayed
def delayed?(klass, *args)
search = encode(job_to_hash(klass, args))
!find_delayed(search).nil?
end

# Returns the next timestap for a delayde job
# Examples
# Resque.next_delayed_schedule MyJob
# Resque.next_delayed_schedule MyJob, id: 1
#
# Returns the timestamp or nil if does not exists any delayed
# scheduled for the job
def next_delayed_schedule(klass, *args)
search = encode(job_to_hash(klass, args))
find_delayed(search)
end
```