design-patterns/behavioral/memento/memento.py
Ruidy bf1d5dd7f0
Memento (#19)
* doc: add documentation

* doc: update general documentation

* add code example
2020-10-03 20:45:32 +02:00

21 lines
437 B
Python

from abc import ABC, abstractmethod
class Memento(ABC):
"""
The Memento interface provides a way to retrieve the memento's metadata,
such as creation date or name. However, it doesn't expose the Originator's
state.
"""
@abstractmethod
def get_state(self) -> str:
pass
@abstractmethod
def get_name(self) -> str:
pass
@abstractmethod
def get_date(self) -> str:
pass