Class: Hyrax::CollectionsService

Inherits:
Object
  • Object
show all
Defined in:
app/services/hyrax/collections_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ CollectionsService

Returns a new instance of CollectionsService.

Parameters:

  • context (#repository, #blacklight_config, #current_ability)


9
10
11
# File 'app/services/hyrax/collections_service.rb', line 9

def initialize(context)
  @context = context
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



3
4
5
# File 'app/services/hyrax/collections_service.rb', line 3

def context
  @context
end

Instance Method Details

#search_results(access) ⇒ Object

Parameters:

  • access (Symbol)

    :read or :edit



14
15
16
17
18
# File 'app/services/hyrax/collections_service.rb', line 14

def search_results(access)
  builder = list_search_builder(access)
  response = context.repository.search(builder)
  response.documents
end