Class: Hyrax::Collections::NestedCollectionQueryService::NestingAttributes Private

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#ancestorsObject

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

#depthObject

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

#idObject

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

#parentsObject

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

#pathnamesObject

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