Sha256: 9843e1eac451248823e46775b6a7027e3a7f3e4ef756d06e2058f9a062b54a56

Contents?: true

Size: 644 Bytes

Versions: 1

Compression:

Stored size: 644 Bytes

Contents

module CurationConcerns
  class AdminSetService
    attr_reader :context

    # @param [#repository,#blacklight_config,#current_ability] context
    def initialize(context)
      @context = context
    end

    # @param [Symbol] access :read or :edit
    def select_options(access = :read)
      search_results(access).map do |element|
        [element.to_s, element.id]
      end
    end

    private

      # @param [Symbol] access :read or :edit
      def search_results(access)
        builder = AdminSetSearchBuilder.new(context, access)
        response = context.repository.search(builder)
        response.documents
      end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
curation_concerns-1.5.0 app/services/curation_concerns/admin_set_service.rb