Class: Hyrax::CollectionsService
- Inherits:
-
SearchService
- Object
- Blacklight::SearchService
- SearchService
- Hyrax::CollectionsService
- Defined in:
- app/services/hyrax/collections_service.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
Instance Method Summary collapse
-
#initialize(context) ⇒ CollectionsService
constructor
A new instance of CollectionsService.
- #search_results(access = nil) ⇒ Object
Constructor Details
#initialize(context) ⇒ CollectionsService
Returns a new instance of CollectionsService.
10 11 12 13 |
# File 'app/services/hyrax/collections_service.rb', line 10 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 |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Hyrax::SearchService
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
4 5 6 |
# File 'app/services/hyrax/collections_service.rb', line 4 def context @context end |
Instance Method Details
#search_results(access = nil) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/services/hyrax/collections_service.rb', line 16 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 |