Matter::Storage::JsonFileBackend
Inherits Matter::Storage::Base < Reference < Object
A simple JSON file backed storage implementation.
Persists the same context-key model as MemoryBackend to a single JSON file.
This is intended as a low-friction default for devices/examples and as the
foundation for future DB-backed implementations.
Constants
TYPE_FIELD = "__type__"
Root JSON keys used to preserve non-JSON-native types
VALUE_FIELD = "value"
Constructors
new(path : String = "matter_storage.json")
SourceInstance methods
clear_all(contexts : Array(String)) : Nil
Sourcedelete(contexts : Array(String), key : String) : Nil
Sourceget(contexts : Array(String), key : String) : Type
Sourceinitialized?
Sourcekeys(contexts : Array(String)) : Array(String)
Sourcepath
Sourceset(contexts : Array(String), key : String, value : Type) : Nil
Sourceset(contexts : Array(String), values : Hash(String, Type)) : Nil
Set multiple key-value pairs at once
start
Sourcestop
Source