require "skala/adapter/search" require_relative "../primo_adapter" class Skala::PrimoAdapter::GetRecords < Skala::Adapter::GetRecords def call(record_ids, options = {}) search_request = Skala::Adapter::Search::Request.new( queries: [ { type: "ids", query: [record_ids].flatten(1) } ] ) search_result = adapter.search(search_request, on_campus: true) # because you know the id -> you searched before self.class::Result.new({records: search_result.hits}).tap do |_get_records_result| _get_records_result.source = search_result.source _get_records_result.each do |_element| _element.found = true _element.version = 1 end end end end