class SidekiqScheduler::RufusUtils

Public Class Methods

normalize_schedule_options(options) click to toggle source

Normalizes schedule options to rufus scheduler options

@param options [String, Array]

@return [Array]

@example

normalize_schedule_options('15m') => ['15m', {}]
normalize_schedule_options(['15m']) => ['15m', {}]
normalize_schedule_options(['15m', first_in: '5m']) => ['15m', { first_in: '5m' }]
# File lib/sidekiq-scheduler/rufus_utils.rb, line 16
def self.normalize_schedule_options(options)
  schedule, opts = options

  if !opts.is_a?(Hash)
    opts = {}
  end

  opts = SidekiqScheduler::Utils.symbolize_keys(opts)

  return schedule, opts
end