Class: Hyrax::Collections::NestedCollectionQueryService::NestingAttributes Private
- Inherits:
 - 
      Object
      
        
- Object
 - Hyrax::Collections::NestedCollectionQueryService::NestingAttributes
 
 
- Defined in:
 - app/services/hyrax/collections/nested_collection_query_service.rb
 
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
an encapsulation of a collection’s nesting index attributes
Instance Attribute Summary collapse
- #ancestors ⇒ Object private
 - #depth ⇒ Object private
 - #id ⇒ Object private
 - #parents ⇒ Object private
 - #pathnames ⇒ Object private
 
Instance Method Summary collapse
- 
  
    
      #initialize(id:, scope:)  ⇒ NestingAttributes 
    
    
  
  
  
    constructor
  
  
  
  
  
  private
  
    
A new instance of NestingAttributes.
 
Constructor Details
#initialize(id:, scope:) ⇒ NestingAttributes
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of NestingAttributes.
      14 15 16 17 18 19 20 21 22 23 24  | 
    
      # File 'app/services/hyrax/collections/nested_collection_query_service.rb', line 14 def initialize(id:, scope:) query_builder = Hyrax::CollectionSearchBuilder.new(scope).where(id: id) query = Hyrax::Collections::NestedCollectionQueryService.clean_lucene_error(builder: query_builder) response = scope.repository.search(query) collection_doc = response.documents.first @id = id @parents = collection_doc[Samvera::NestingIndexer.configuration.solr_field_name_for_storing_parent_ids] @pathnames = collection_doc[Samvera::NestingIndexer.configuration.solr_field_name_for_storing_pathnames] @ancestors = collection_doc[Samvera::NestingIndexer.configuration.solr_field_name_for_storing_ancestors] @depth = collection_doc[Samvera::NestingIndexer.configuration.solr_field_name_for_deepest_nested_depth] end  | 
  
Instance Attribute Details
#ancestors ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
      12 13 14  | 
    
      # File 'app/services/hyrax/collections/nested_collection_query_service.rb', line 12 def ancestors @ancestors end  | 
  
#depth ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
      12 13 14  | 
    
      # File 'app/services/hyrax/collections/nested_collection_query_service.rb', line 12 def depth @depth end  | 
  
#id ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
      12 13 14  | 
    
      # File 'app/services/hyrax/collections/nested_collection_query_service.rb', line 12 def id @id end  | 
  
#parents ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
      12 13 14  | 
    
      # File 'app/services/hyrax/collections/nested_collection_query_service.rb', line 12 def parents @parents end  | 
  
#pathnames ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
      12 13 14  | 
    
      # File 'app/services/hyrax/collections/nested_collection_query_service.rb', line 12 def pathnames @pathnames end  |