# These functions encapsulate various job utilities.
# They must be simple and free from side effects.
defvalidate(item)
raise(ArgumentError,"Job must be a Hash with 'class' and 'args' keys: `#{item}`")unlessitem.is_a?(Hash)&&item.key?("class")&&item.key?("args")
raise(ArgumentError,"Job args must be an Array: `#{item}`")unlessitem["args"].is_a?(Array)
raise(ArgumentError,"Job class must be either a Class or String representation of the class name: `#{item}`")unlessitem["class"].is_a?(Class)||item["class"].is_a?(String)
raise(ArgumentError,"Job 'at' must be a Numeric timestamp: `#{item}`")ifitem.key?("at")&&!item["at"].is_a?(Numeric)
raise(ArgumentError,"Job tags must be an Array: `#{item}`")ifitem["tags"]&&!item["tags"].is_a?(Array)
raise(ArgumentError,"Message must include a Sidekiq::Job class, not class name: #{item_class.ancestors.inspect}")unlessitem_class.respond_to?(:get_sidekiq_options)