# frozen_string_literal: true module Wayfarer class Serializer < ActiveJob::Serializers::ObjectSerializer def serialize?(obj) obj.is_a?(Wayfarer::Task) end def serialize(task) super("url" => task.url, "batch" => task.batch) end def deserialize(hash) Wayfarer::Task.new(*hash.values_at("url", "batch")) end end end