Module: Samvera::NestingIndexer::Adapters::AbstractAdapter

Included in:
InMemoryAdapter
Defined in:
lib/samvera/nesting_indexer/adapters/abstract_adapter.rb

Overview

A module that defines the interface of methods required to interact with Samvera::NestingIndexer operations rubocop:disable Lint/UnusedMethodArgument

Class Method Summary collapse

Class Method Details

.each_child_document_of(document:) {|Samvera::NestingIndexer::Documents::IndexDocument| ... } ⇒ Object

Parameters:

Yields:

Raises:

  • (NotImplementedError)


41
42
43
# File 'lib/samvera/nesting_indexer/adapters/abstract_adapter.rb', line 41

def self.each_child_document_of(document:, &block)
  raise NotImplementedError
end

.each_perservation_document_id_and_parent_ids {|id, parent_ids| ... } ⇒ Object

Yield Parameters:

  • id (String)

    The ‘id` of the preservation document

  • parent_ids (String)

    The ids of the parent objects of this presevation document

Raises:

  • (NotImplementedError)

Since:

  • 0.7.0



26
27
28
# File 'lib/samvera/nesting_indexer/adapters/abstract_adapter.rb', line 26

def self.each_perservation_document_id_and_parent_ids(&block)
  raise NotImplementedError
end

.find_index_document_by(id:) ⇒ Samvera::NestingIndexer::Documents::IndexDocument

Parameters:

  • id (String)

Returns:

Raises:

  • (NotImplementedError)


18
19
20
# File 'lib/samvera/nesting_indexer/adapters/abstract_adapter.rb', line 18

def self.find_index_document_by(id:)
  raise NotImplementedError
end

.find_preservation_document_by(id:) ⇒ Samvera::NestingIndexer::Document::PreservationDocument

Parameters:

  • id (String)

Returns:

  • (Samvera::NestingIndexer::Document::PreservationDocument)

Raises:

  • (NotImplementedError)


11
12
13
# File 'lib/samvera/nesting_indexer/adapters/abstract_adapter.rb', line 11

def self.find_preservation_document_by(id:)
  raise NotImplementedError
end

.find_preservation_parent_ids_for(id:) ⇒ Array<String>

Returns The parent ids of the given preservation document.

Parameters:

  • id (String)

    The ‘id` of the preservation document

Returns:

  • (Array<String>)

    The parent ids of the given preservation document

Raises:

  • (NotImplementedError)

Since:

  • 0.7.0



34
35
36
# File 'lib/samvera/nesting_indexer/adapters/abstract_adapter.rb', line 34

def self.find_preservation_parent_ids_for(id:)
  raise NotImplementedError
end

.write_document_attributes_to_index_layer(id:, parent_ids:, ancestors:, pathnames:, deepest_nested_depth:) ⇒ Object

Deprecated.

Use .write_nesting_document_to_index_layer instead

Returns Hash - the attributes written to the indexing layer.

Parameters:

  • id (String)
  • parent_ids (Array<String>)
  • ancestors (Array<String>)
  • pathnames (Array<String>)
  • deepest_nested_depth (Integer)

Returns:

  • Hash - the attributes written to the indexing layer

Raises:

  • (NotImplementedError)

See Also:

  • README.md


54
55
56
# File 'lib/samvera/nesting_indexer/adapters/abstract_adapter.rb', line 54

def self.write_document_attributes_to_index_layer(id:, parent_ids:, ancestors:, pathnames:, deepest_nested_depth:)
  raise NotImplementedError
end

.write_nesting_document_to_index_layer(nesting_document:) ⇒ Object

Returns void.

Parameters:

  • nesting_document (Samvera::NestingIndexer::Document::IndexDocument)

Returns:

  • void

Raises:

  • (NotImplementedError)

See Also:

  • README.md

Since:

  • v1.0.0



63
64
65
# File 'lib/samvera/nesting_indexer/adapters/abstract_adapter.rb', line 63

def self.write_nesting_document_to_index_layer(nesting_document:)
  raise NotImplementedError
end