Class: Aeternitas::StorageAdapter Abstract
- Inherits:
-
Object
- Object
- Aeternitas::StorageAdapter
- Defined in:
- lib/aeternitas/storage_adapter.rb,
lib/aeternitas/storage_adapter/file.rb
Overview
Direct Known Subclasses
Defined Under Namespace
Classes: File
Instance Method Summary collapse
-
#delete(id) ⇒ Boolean
abstract
Delete the entry with the given fingerprint.
-
#exist?(id) ⇒ Boolean
abstract
Checks whether the entry with the given fingerprint exists.
-
#initialize(config) ⇒ StorageAdapter
constructor
Create a new storage adapter.
-
#retrieve(id) ⇒ String
abstract
Retrieves the content of the entry with the given fingerprint.
-
#store(id, raw_content) ⇒ Object
abstract
Store a new entry with the given id and raw content.
Constructor Details
#initialize(config) ⇒ StorageAdapter
Create a new storage adapter
8 9 10 |
# File 'lib/aeternitas/storage_adapter.rb', line 8 def initialize(config) @config = config end |
Instance Method Details
#delete(id) ⇒ Boolean
This method is abstract.
Delete the entry with the given fingerprint
32 33 34 |
# File 'lib/aeternitas/storage_adapter.rb', line 32 def delete(id) raise NotImplementedError, "#{self.class.name} does not implement #delete, required by Aeternitas::StorageAdapter" end |
#exist?(id) ⇒ Boolean
This method is abstract.
Checks whether the entry with the given fingerprint exists.
40 41 42 |
# File 'lib/aeternitas/storage_adapter.rb', line 40 def exist?(id) raise NotImplementedError, "#{self.class.name} does not implement #exist?, required by Aeternitas::StorageAdapter" end |
#retrieve(id) ⇒ String
This method is abstract.
Retrieves the content of the entry with the given fingerprint
24 25 26 |
# File 'lib/aeternitas/storage_adapter.rb', line 24 def retrieve(id) raise NotImplementedError, "#{self.class.name} does not implement #retrive, required by Aeternitas::StorageAdapter" end |
#store(id, raw_content) ⇒ Object
This method is abstract.
Store a new entry with the given id and raw content
16 17 18 |
# File 'lib/aeternitas/storage_adapter.rb', line 16 def store(id, raw_content) raise NotImplementedError, "#{self.class.name} does not implement #store, required by Aeternitas::StorageAdapter" end |