Serialize¶
Abstract class for a JSON serializable object.
- class mundo.api.serialize.SerializableObject(data: Dict[str, Any])¶
Abstract base class for a (JSON) serializable object. All data objects/instances that should be saved to a file that are not saved directly in the corresponding config class should inherit from this class.
Inherting from this class allows the data to implement a custom serialization method that will be used to convert the data of the object into a dictionary that can be encoded to JSON and written to a file.
- __init__(data: Dict[str, Any]) None¶
Creates a new object based on saved serialized data.
- Parameters
data – The saved serialized data
- abstract serialize() Dict[str, Any]¶
Serialize the object into a JSON-encodable dictionary.
- Returns
The serialized data as a dictionary containing all the data that should be saved to file