module Scrivito class ObjSearchEnumerator class Batch def initialize(objs, total, continuation, facets, previously_fetched_ids) @objs = filter_duplicates(objs, previously_fetched_ids) @total = total @continuation = continuation @facets = facets end attr_reader :objs, :total, :continuation, :facets private def filter_duplicates(objs, previously_fetched_ids) objs.reject do |obj| previously_fetched_ids.include?(obj.id) end end end end end