Sha256: dceded8472b23b188e10a6e99aa9cd079b09a3160f89aca5d5e5bd302de3bcfc

Contents?: true

Size: 344 Bytes

Versions: 18

Compression:

Stored size: 344 Bytes

Contents

module Crono
  # Scheduler is a container for job list and queue
  class Scheduler
    attr_accessor :jobs

    def initialize
      self.jobs = []
    end

    def add_job(job)
      job.load
      jobs << job
    end

    def next_jobs
      jobs.group_by(&:next).sort_by {|time,_| time }.first
    end
  end

  mattr_accessor :scheduler
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
crono-2.1.0 lib/crono/scheduler.rb
crono-2.0.1 lib/crono/scheduler.rb
crono-2.0.0 lib/crono/scheduler.rb
crono-1.1.2 lib/crono/scheduler.rb
crono-1.1.1 lib/crono/scheduler.rb
crono-1.1.0 lib/crono/scheduler.rb
crono-1.0.3 lib/crono/scheduler.rb
crono-1.0.2 lib/crono/scheduler.rb
crono-1.0.1 lib/crono/scheduler.rb
crono-1.0.0 lib/crono/scheduler.rb
crono-1.0.0.pre3 lib/crono/scheduler.rb
crono-1.0.0.pre2 lib/crono/scheduler.rb
crono-0.9.0 lib/crono/scheduler.rb
crono-0.8.9 lib/crono/scheduler.rb
crono-0.8.9.pre lib/crono/scheduler.rb
crono-0.8.8.pre lib/crono/scheduler.rb
crono-0.8.7.pre lib/crono/scheduler.rb
crono-0.8.6.pre lib/crono/scheduler.rb