Class: StrokeDB::FileChunkStorage
- Inherits:
-
ChunkStorage
- Object
- ChunkStorage
- StrokeDB::FileChunkStorage
- Defined in:
- lib/stores/skiplist_store/file_chunk_storage.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
Attributes inherited from ChunkStorage
Instance Method Summary collapse
- #clear! ⇒ Object
- #delete!(chunk_uuid) ⇒ Object
-
#initialize(opts = {}) ⇒ FileChunkStorage
constructor
A new instance of FileChunkStorage.
Methods inherited from ChunkStorage
Methods included from ChainableStorage
#add_chained_storage!, #has_chained_storage?, #remove_chained_storage!, #save_with_chained_storages!, #save_without_chained_storages!, #sync_chained_storage!, #sync_chained_storages!
Constructor Details
#initialize(opts = {}) ⇒ FileChunkStorage
Returns a new instance of FileChunkStorage.
5 6 7 8 |
# File 'lib/stores/skiplist_store/file_chunk_storage.rb', line 5 def initialize(opts={}) opts = opts.stringify_keys @path = opts['path'] end |
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
3 4 5 |
# File 'lib/stores/skiplist_store/file_chunk_storage.rb', line 3 def path @path end |
Instance Method Details
#clear! ⇒ Object
14 15 16 |
# File 'lib/stores/skiplist_store/file_chunk_storage.rb', line 14 def clear! FileUtils.rm_rf @path end |
#delete!(chunk_uuid) ⇒ Object
10 11 12 |
# File 'lib/stores/skiplist_store/file_chunk_storage.rb', line 10 def delete!(chunk_uuid) FileUtils.rm_rf(chunk_path(chunk_uuid)) end |