MCPcopy Create free account
hub / github.com/RefactoringGuru/design-patterns-python / Memento

Class Memento

src/Memento/Conceptual/main.py:84–101  ·  view source on GitHub ↗

EN: 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. RU: Интерфейс Снимка предоставляет способ извлечения метаданных снимка, таких как дата создания или название. Однако он

Source from the content-addressed store, hash-verified

82
83
84class Memento(ABC):
85 """
86 EN: The Memento interface provides a way to retrieve the memento's metadata,
87 such as creation date or name. However, it doesn't expose the Originator's
88 state.
89
90 RU: Интерфейс Снимка предоставляет способ извлечения метаданных снимка,
91 таких как дата создания или название. Однако он не раскрывает состояние
92 Создателя.
93 """
94
95 @abstractmethod
96 def get_name(self) -> str:
97 pass
98
99 @abstractmethod
100 def get_date(self) -> str:
101 pass
102
103
104class ConcreteMemento(Memento):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected