Class: Hyrax::CollectionMemberService
- Inherits:
-
Object
- Object
- Hyrax::CollectionMemberService
- Includes:
- Blacklight::Configurable
- Defined in:
- app/services/hyrax/collection_member_service.rb
Overview
Returns a list of solr documents for collections the item is a part of
Instance Attribute Summary collapse
-
#current_ability ⇒ Object
readonly
Returns the value of attribute current_ability.
-
#item ⇒ Object
readonly
Returns the value of attribute item.
Class Method Summary collapse
Instance Method Summary collapse
- #collection_search_builder ⇒ Object
-
#initialize(item, ability) ⇒ CollectionMemberService
constructor
A new instance of CollectionMemberService.
- #list_collections ⇒ Object
- #search_state_class ⇒ Object
Constructor Details
#initialize(item, ability) ⇒ CollectionMemberService
Returns a new instance of CollectionMemberService.
20 21 22 23 |
# File 'app/services/hyrax/collection_member_service.rb', line 20 def initialize(item, ability) @item = item @current_ability = ability end |
Instance Attribute Details
#current_ability ⇒ Object (readonly)
Returns the value of attribute current_ability.
9 10 11 |
# File 'app/services/hyrax/collection_member_service.rb', line 9 def current_ability @current_ability end |
#item ⇒ Object (readonly)
Returns the value of attribute item.
9 10 11 |
# File 'app/services/hyrax/collection_member_service.rb', line 9 def item @item end |
Class Method Details
.run(item, ability) ⇒ Object
16 17 18 |
# File 'app/services/hyrax/collection_member_service.rb', line 16 def self.run(item, ability) new(item, ability).list_collections end |
Instance Method Details
#collection_search_builder ⇒ Object
31 32 33 |
# File 'app/services/hyrax/collection_member_service.rb', line 31 def collection_search_builder @collection_search_builder ||= ParentCollectionSearchBuilder.new([:include_item_ids, :add_paging_to_solr, :add_access_controls_to_solr_params], self) end |
#list_collections ⇒ Object
25 26 27 28 29 |
# File 'app/services/hyrax/collection_member_service.rb', line 25 def list_collections query = collection_search_builder.rows(1000) resp = blacklight_config.repository.search(query) resp.documents end |
#search_state_class ⇒ Object
35 |
# File 'app/services/hyrax/collection_member_service.rb', line 35 def search_state_class; end |