Class: Valkyrie::Persistence::Memory::MetadataAdapter
- Inherits:
-
Object
- Object
- Valkyrie::Persistence::Memory::MetadataAdapter
- Defined in:
- lib/valkyrie/persistence/memory/metadata_adapter.rb
Overview
Note:
Documentation for instance methods on other MetadataAdapters are copied from the Memory implementation via ‘(see Valkyrie::Persistence::Memory#method)` to reduce duplication.
MetadataAdapter for the memory adapter.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#cache ⇒ Hash
The in-memory data cache.
Instance Method Summary collapse
-
#id ⇒ Valkyrie::ID
Identifier for this metadata adapter.
-
#persister ⇒ Valkyrie::Persistence::Memory::Persister
A memory persister for this adapter.
-
#query_service ⇒ Valkyrie::Persistence::Memory::QueryService
A query service for this adapter.
Instance Attribute Details
#cache ⇒ Hash
Returns The in-memory data cache.
24 25 26 |
# File 'lib/valkyrie/persistence/memory/metadata_adapter.rb', line 24 def cache @cache ||= {} end |
Instance Method Details
#id ⇒ Valkyrie::ID
Returns Identifier for this metadata adapter.
29 30 31 |
# File 'lib/valkyrie/persistence/memory/metadata_adapter.rb', line 29 def id @id ||= Valkyrie::ID.new(Digest::MD5.hexdigest(self.class.to_s)) end |
#persister ⇒ Valkyrie::Persistence::Memory::Persister
Returns A memory persister for this adapter.
13 14 15 |
# File 'lib/valkyrie/persistence/memory/metadata_adapter.rb', line 13 def persister Valkyrie::Persistence::Memory::Persister.new(self) end |
#query_service ⇒ Valkyrie::Persistence::Memory::QueryService
Returns A query service for this adapter.
19 20 21 |
# File 'lib/valkyrie/persistence/memory/metadata_adapter.rb', line 19 def query_service @query_service ||= Valkyrie::Persistence::Memory::QueryService.new(adapter: self) end |