Sha256: b415ce5cd12aca530b29f2f32b47cb42dadf7471540c954d561a10b37dfd37b5

Contents?: true

Size: 852 Bytes

Versions: 28

Compression:

Stored size: 852 Bytes

Contents

# frozen_string_literal: true
module Hyrax
  class CollectionsService < Hyrax::SearchService
    attr_reader :context

    class_attribute :list_search_builder_class
    self.list_search_builder_class = Hyrax::CollectionSearchBuilder

    # @param [#repository,#blacklight_config,#current_ability] context
    def initialize(context)
      super(config: context.blacklight_config, user_params: context.params, search_builder_class: self.class.list_search_builder_class, scope: context)
      @current_ability = context.current_ability
    end

    # @param [Symbol] access :read or :edit
    def search_results(access = nil)
      response, _docs = super() do |builder|
        builder.with_access(access) if access
        builder.rows(100)

        yield builder if block_given?

        builder
      end

      response.documents
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
hyrax-5.1.0.pre.beta1 app/services/hyrax/collections_service.rb
hyrax-5.0.4 app/services/hyrax/collections_service.rb
hyrax-5.0.3 app/services/hyrax/collections_service.rb
hyrax-5.0.2 app/services/hyrax/collections_service.rb
hyrax-5.0.1 app/services/hyrax/collections_service.rb
hyrax-5.0.0 app/services/hyrax/collections_service.rb
hyrax-5.0.0.rc3 app/services/hyrax/collections_service.rb
hyrax-5.0.0.rc2 app/services/hyrax/collections_service.rb
hyrax-5.0.0.rc1 app/services/hyrax/collections_service.rb
hyrax-3.6.0 app/services/hyrax/collections_service.rb
hyrax-4.0.0 app/services/hyrax/collections_service.rb
hyrax-4.0.0.rc3 app/services/hyrax/collections_service.rb
hyrax-4.0.0.rc2 app/services/hyrax/collections_service.rb
hyrax-4.0.0.rc1 app/services/hyrax/collections_service.rb
hyrax-3.5.0 app/services/hyrax/collections_service.rb
hyrax-4.0.0.beta2 app/services/hyrax/collections_service.rb
hyrax-3.4.2 app/services/hyrax/collections_service.rb
hyrax-4.0.0.beta1 app/services/hyrax/collections_service.rb
hyrax-3.4.1 app/services/hyrax/collections_service.rb
hyrax-3.4.0 app/services/hyrax/collections_service.rb