class
Sepia::Storage
- Sepia::Storage
- Reference
- Object
Overview
The Storage
class is responsible for handling the persistence of
Sepia::Serializable
and Sepia::Container
objects to the file system.
It manages saving and loading these objects based on their sepia_id
and class name, and provides a configurable storage path.
Defined in:
sepia/storage.crConstant Summary
-
INSTANCE =
new
Instance Method Summary
- #delete(object : Serializable)
- #delete(object : Container)
-
#load(object_class : T.class, id : String, path : String | Nil = nil) : T forall T
Load an object from the canonical path in sepia format.
-
#path : String
By default, the storage path is a temporary directory.
-
#path=(path : String)
But user can override it.
-
#save(object : Serializable, path : String | Nil = nil)
Saves a Serializable object to its canonical path.
-
#save(object : Container, path : String | Nil = nil)
Saves a Container object to its canonical path as a directory.
Instance Method Detail
Load an object from the canonical path in sepia format. T must be a class that includes Sepia::Serializable or Sepia::Container.
But user can override it. Sets the storage path. This is where all serialized objects will be stored.
Saves a Serializable object to its canonical path.
The object's to_sepia
method is used to get the content to be saved.
Saves a Container object to its canonical path as a directory.
The container's save_references
method is called to save its contents.