Package pypat :: Package behavioral :: Module memento :: Class Originator
[hide private]
[frames] | no frames]

Class Originator

source code

object --+
         |
        Originator


Originator base class as part of the Memento design pattern.

- External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Behavioral-Pattern-Usage}
- External Mediator Pattern documentation: U{https://en.wikipedia.org/wiki/Memento_pattern}

Instance Methods [hide private]
 
commit(self)
Commit this objects state to a memento.
source code
 
rollback(self, memento)
Rollback this objects state to a previous state.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

commit(self)

source code 

Commit this objects state to a memento.

Returns:
A memento instance with this objects state.

rollback(self, memento)

source code 

Rollback this objects state to a previous state.

Parameters:
  • memento (Memento) - The memento object holding the state to rollback to.