Class: Railscope::Storage::Base
- Inherits:
-
Object
- Object
- Railscope::Storage::Base
- Defined in:
- lib/railscope/storage/base.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#all(filters: {}, page: 1, per_page: 25, displayable_only: true) ⇒ Array<EntryData>
List entries with optional filters.
-
#count(filters: {}, displayable_only: true) ⇒ Integer
Count entries with optional filters.
-
#destroy_all! ⇒ Integer
Delete all entries.
-
#destroy_expired! ⇒ Integer
Delete expired entries (older than retention_days).
-
#family_count(family_hash) ⇒ Integer
Count entries with the same family hash.
-
#find(uuid) ⇒ EntryData?
Find an entry by UUID.
-
#find!(uuid) ⇒ EntryData
Find an entry by UUID, raising if not found.
-
#for_batch(batch_id) ⇒ Array<EntryData>
Get all entries in a batch.
-
#for_family(family_hash, page: 1, per_page: 25) ⇒ Array<EntryData>
Get all entries with the same family hash.
-
#ready? ⇒ Boolean
Check if storage is available and ready.
-
#write(attributes) ⇒ EntryData
Write a new entry.
Instance Method Details
#all(filters: {}, page: 1, per_page: 25, displayable_only: true) ⇒ Array<EntryData>
List entries with optional filters
34 35 36 |
# File 'lib/railscope/storage/base.rb', line 34 def all(filters: {}, page: 1, per_page: 25, displayable_only: true) raise NotImplementedError, "#{self.class}#all must be implemented" end |
#count(filters: {}, displayable_only: true) ⇒ Integer
Count entries with optional filters
42 43 44 |
# File 'lib/railscope/storage/base.rb', line 42 def count(filters: {}, displayable_only: true) raise NotImplementedError, "#{self.class}#count must be implemented" end |
#destroy_all! ⇒ Integer
Delete all entries
71 72 73 |
# File 'lib/railscope/storage/base.rb', line 71 def destroy_all! raise NotImplementedError, "#{self.class}#destroy_all! must be implemented" end |
#destroy_expired! ⇒ Integer
Delete expired entries (older than retention_days)
77 78 79 |
# File 'lib/railscope/storage/base.rb', line 77 def destroy_expired! raise NotImplementedError, "#{self.class}#destroy_expired! must be implemented" end |
#family_count(family_hash) ⇒ Integer
Count entries with the same family hash
65 66 67 |
# File 'lib/railscope/storage/base.rb', line 65 def family_count(family_hash) raise NotImplementedError, "#{self.class}#family_count must be implemented" end |
#find(uuid) ⇒ EntryData?
Find an entry by UUID
16 17 18 |
# File 'lib/railscope/storage/base.rb', line 16 def find(uuid) raise NotImplementedError, "#{self.class}#find must be implemented" end |
#find!(uuid) ⇒ EntryData
Find an entry by UUID, raising if not found
24 25 26 |
# File 'lib/railscope/storage/base.rb', line 24 def find!(uuid) find(uuid) || raise(RecordNotFound, "Entry not found: #{uuid}") end |
#for_batch(batch_id) ⇒ Array<EntryData>
Get all entries in a batch
49 50 51 |
# File 'lib/railscope/storage/base.rb', line 49 def for_batch(batch_id) raise NotImplementedError, "#{self.class}#for_batch must be implemented" end |
#for_family(family_hash, page: 1, per_page: 25) ⇒ Array<EntryData>
Get all entries with the same family hash
58 59 60 |
# File 'lib/railscope/storage/base.rb', line 58 def for_family(family_hash, page: 1, per_page: 25) raise NotImplementedError, "#{self.class}#for_family must be implemented" end |
#ready? ⇒ Boolean
Check if storage is available and ready
83 84 85 |
# File 'lib/railscope/storage/base.rb', line 83 def ready? raise NotImplementedError, "#{self.class}#ready? must be implemented" end |
#write(attributes) ⇒ EntryData
Write a new entry
9 10 11 |
# File 'lib/railscope/storage/base.rb', line 9 def write(attributes) raise NotImplementedError, "#{self.class}#write must be implemented" end |