abstract class
Sepia::StorageBackend
- Sepia::StorageBackend
- Reference
- Object
Overview
Abstract base class for storage backends. All storage implementations must inherit from this class.
Direct Known Subclasses
Defined in:
sepia/storage_backend.crInstance Method Summary
-
#clear
Clear all data (useful for testing)
-
#count(object_class : Class) : Int32
Count objects of a given class
-
#delete(class_name : String, id : String)
Delete an object by its class name and ID
-
#delete(object : Serializable | Container)
Delete an object
-
#exists?(object_class : Class, id : String) : Bool
Check if an object exists
-
#export_data : Hash(String, Array(Hash(String, String)))
Export all data as a hash structure
-
#import_data(data : Hash(String, Array(Hash(String, String))))
Import data from a hash structure
-
#list_all(object_class : Class) : Array(String)
List all object IDs of a given class
-
#list_all_objects : Hash(String, Array(String))
List all objects, grouped by class name
-
#load(object_class : Class, id : String, path : String | Nil = nil) : Object
Load an object by class and ID
-
#save(object : Serializable, path : String | Nil = nil)
Save a Serializable object
-
#save(object : Container, path : String | Nil = nil)
Save a Container object
Instance Method Detail
abstract
def export_data : Hash(String, Array(Hash(String, String)))
#
Export all data as a hash structure
abstract
def import_data(data : Hash(String, Array(Hash(String, String))))
#
Import data from a hash structure
abstract
def list_all_objects : Hash(String, Array(String))
#
List all objects, grouped by class name
Load an object by class and ID
Save a Serializable object
Save a Container object