Module: Curate::Indexer::Adapters::InMemoryAdapter
- Extended by:
- AbstractAdapter
- Defined in:
- lib/curate/indexer/adapters/in_memory_adapter.rb
Overview
Defines the interface for interacting with the InMemory layer. It is a reference implementation that is used throughout tests.
Class Method Summary collapse
- .clear_cache! ⇒ Object private
- .each_child_document_of(document) { ... } ⇒ Object
- .each_preservation_document { ... } ⇒ Object
-
.find_index_document_by(pid) ⇒ Object
Curate::Indexer::Documents::IndexDocument.
-
.find_preservation_document_by(pid) ⇒ Object
Curate::Indexer::Document::PreservationDocument.
-
.write_document_attributes_to_index_layer(attributes = {}) ⇒ Object
Curate::Indexer::Documents::IndexDocument.
-
.write_document_attributes_to_preservation_layer(attributes = {}) ⇒ Object
This is not something that I envision using in the production environment; It is hear to keep the Preservation system isolated and accessible only through interfaces.
Class Method Details
.clear_cache! ⇒ 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.
53 54 55 56 |
# File 'lib/curate/indexer/adapters/in_memory_adapter.rb', line 53 def self.clear_cache! Preservation.clear_cache! Index.clear_cache! end |
.each_child_document_of(document) { ... } ⇒ Object
34 35 36 |
# File 'lib/curate/indexer/adapters/in_memory_adapter.rb', line 34 def self.each_child_document_of(document, &block) Index.each_child_document_of(document, &block) end |
.each_preservation_document { ... } ⇒ Object
27 28 29 |
# File 'lib/curate/indexer/adapters/in_memory_adapter.rb', line 27 def self.each_preservation_document Preservation.find_each { |document| yield(document) } end |
.find_index_document_by(pid) ⇒ Object
Returns Curate::Indexer::Documents::IndexDocument.
21 22 23 |
# File 'lib/curate/indexer/adapters/in_memory_adapter.rb', line 21 def self.find_index_document_by(pid) Index.find(pid) end |
.find_preservation_document_by(pid) ⇒ Object
Returns Curate::Indexer::Document::PreservationDocument.
14 15 16 |
# File 'lib/curate/indexer/adapters/in_memory_adapter.rb', line 14 def self.find_preservation_document_by(pid) Preservation.find(pid) end |
.write_document_attributes_to_index_layer(attributes = {}) ⇒ Object
Returns Curate::Indexer::Documents::IndexDocument.
48 49 50 |
# File 'lib/curate/indexer/adapters/in_memory_adapter.rb', line 48 def self.write_document_attributes_to_index_layer(attributes = {}) Index.write_document(attributes) end |
.write_document_attributes_to_preservation_layer(attributes = {}) ⇒ Object
This is not something that I envision using in the production environment; It is hear to keep the Preservation system isolated and accessible only through interfaces.
42 43 44 |
# File 'lib/curate/indexer/adapters/in_memory_adapter.rb', line 42 def self.write_document_attributes_to_preservation_layer(attributes = {}) Preservation.write_document(attributes) end |