Sha256: 6c91bd8a3ad940db9e716bb450c03489d1825281b15f8d38b1be8f1b2eedeadd

Contents?: true

Size: 495 Bytes

Versions: 4

Compression:

Stored size: 495 Bytes

Contents

module Sidetiq
  # Internal: Recurrence schedules.
  class Schedule < IceCube::Schedule
    def method_missing(meth, *args, &block)
      if IceCube::Rule.respond_to?(meth)
        rule = IceCube::Rule.send(meth, *args, &block)
        add_recurrence_rule(rule)
        rule
      else
        super
      end
    end

    def schedule_next?(time)
      if @last_scheduled != (no = next_occurrence(time))
        @last_scheduled = no
        return true
      end
      false
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sidetiq-0.2.0 lib/sidetiq/schedule.rb
sidetiq-0.1.5 lib/sidetiq/schedule.rb
sidetiq-0.1.4 lib/sidetiq/schedule.rb
sidetiq-0.1.3 lib/sidetiq/schedule.rb