lib/job-iteration/enumerator_builder.rb
def build_array_enumerator(enumerable, cursor:)
      unless enumerable.is_a?(Array)
        raise ArgumentError, "enumerable must be an Array"
      end
      if enumerable.any? { |i| defined?(ActiveRecord) && i.is_a?(ActiveRecord::Base) }
        raise ArgumentError, "array cannot contain ActiveRecord objects"
      end
      drop =
        if cursor.nil?
          0
        else
          cursor + 1
        end

      wrap(self, enumerable.each_with_index.drop(drop).to_enum { enumerable.size })
    end
def build_array_enumerator(enumerable, cursor:)
      unless enumerable.is_a?(Array)
        raise ArgumentError, "enumerable must be an Array"
      end
      if enumerable.any? { |i| defined?(ActiveRecord) && i.is_a?(ActiveRecord::Base) }
        raise ArgumentError, "array cannot contain ActiveRecord objects"
      end
      drop =
        if cursor.nil?
          0
        else
          cursor + 1
        end

      wrap(self, enumerable.each_with_index.drop(drop).to_enum { enumerable.size })
    end
Builds Enumerator object from a given array, using +cursor+ as an offset.