Sha256: 0e0caf15c88f36d1abf78831af357c44bbdff915dab95f182c81a6192bc2dce9

Contents?: true

Size: 525 Bytes

Versions: 29

Compression:

Stored size: 525 Bytes

Contents

# frozen_string_literal: true

module Spotlight
  module Resources
    # transforms a IiifHarvester into solr documents
    class IiifBuilder < Spotlight::SolrDocumentBuilder
      def to_solr
        return to_enum(:to_solr) { 0 } unless block_given?

        base_doc = super
        resource.iiif_manifests.each do |manifest|
          manifest.with_exhibit(exhibit)
          manifest_solr = manifest.to_solr
          yield base_doc.merge(manifest_solr) if manifest_solr.present?
        end
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
blacklight-spotlight-2.7.2 app/services/spotlight/resources/iiif_builder.rb
blacklight-spotlight-2.7.1 app/services/spotlight/resources/iiif_builder.rb
blacklight-spotlight-2.7.0 app/services/spotlight/resources/iiif_builder.rb
blacklight-spotlight-2.6.1.1 app/services/spotlight/resources/iiif_builder.rb
blacklight-spotlight-2.6.1 app/services/spotlight/resources/iiif_builder.rb
blacklight-spotlight-2.6.0 app/services/spotlight/resources/iiif_builder.rb
blacklight-spotlight-2.5.2 app/services/spotlight/resources/iiif_builder.rb
blacklight-spotlight-2.5.1 app/services/spotlight/resources/iiif_builder.rb
blacklight-spotlight-2.5.0 app/services/spotlight/resources/iiif_builder.rb