Sha256: 6e6d744951cdc46edc1bc5de63c5b109afda5c298895da6acabd86a61b977391

Contents?: true

Size: 710 Bytes

Versions: 13

Compression:

Stored size: 710 Bytes

Contents

# frozen_string_literal: true
module Hyrax
  class RestrictionService
    class << self
      ##
      # @note needed to construct SearchBuilders using self in Blacklight 7+
      delegate :blacklight_config, to: :config

      private

      def presenter_class
        raise "RestrictionService is an Abstract class and should be extended. Implement presenter_class in the subclass"
      end

      def presenters(builder)
        response = repository.search(builder)
        response.documents.map { |d| presenter_class.new(d) }
      end

      def repository
        config.blacklight_config.repository
      end

      def config
        @config ||= ::CatalogController.new
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
hyrax-5.1.0.pre.beta1 app/services/hyrax/restriction_service.rb
hyrax-5.0.4 app/services/hyrax/restriction_service.rb
hyrax-5.0.3 app/services/hyrax/restriction_service.rb
hyrax-5.0.2 app/services/hyrax/restriction_service.rb
hyrax-5.0.1 app/services/hyrax/restriction_service.rb
hyrax-5.0.0 app/services/hyrax/restriction_service.rb
hyrax-5.0.0.rc3 app/services/hyrax/restriction_service.rb
hyrax-5.0.0.rc2 app/services/hyrax/restriction_service.rb
hyrax-5.0.0.rc1 app/services/hyrax/restriction_service.rb
hyrax-4.0.0 app/services/hyrax/restriction_service.rb
hyrax-4.0.0.rc3 app/services/hyrax/restriction_service.rb
hyrax-4.0.0.rc2 app/services/hyrax/restriction_service.rb
hyrax-4.0.0.rc1 app/services/hyrax/restriction_service.rb