Sha256: f717f05b217d556585af71d7ce508c39818163294f88bff66f6514ab926870be

Contents?: true

Size: 290 Bytes

Versions: 1

Compression:

Stored size: 290 Bytes

Contents

module Crono
  class Schedule
    attr_accessor :schedule

    def initialize
      self.schedule = []
    end

    def add(job)
      schedule << job
    end

    def next
      queue.first
    end

  private
    def queue
      schedule.sort { |a,b| a.next <=> b.next }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
crono-0.5.2 lib/crono/schedule.rb