class Sidekiq::Scheduler

def load_schedule_job(name, config)

Loads a job schedule into the Rufus::Scheduler and stores it in @@scheduled_jobs
def load_schedule_job(name, config)
  # If rails_env is set in the config, enforce ENV['RAILS_ENV'] as
  # required for the jobs to be scheduled.  If rails_env is missing, the
  # job should be scheduled regardless of what ENV['RAILS_ENV'] is set
  # to.
  if config['rails_env'].nil? || rails_env_matches?(config)
    logger.info "Scheduling #{name} #{config}"
    interval_defined = false
    interval_types = %w{cron every at in interval}
    interval_types.each do |interval_type|
      config_interval_type = config[interval_type]
      if !config_interval_type.nil? && config_interval_type.length > 0
        args = optionizate_interval_value(config_interval_type)
        rufus_job = new_job(name, interval_type, config, args)
        @@scheduled_jobs[name] = rufus_job
        update_job_next_time(name, rufus_job.next_time)
        interval_defined = true
        break
      end
    end
    unless interval_defined
      logger.info "no #{interval_types.join(' / ')} found for #{config['class']} (#{name}) - skipping"
    end
  end
end