Package pypat :: Package behavioral :: Module chain :: Class Chain
[hide private]
[frames] | no frames]

Class Chain

source code


Abstract Chain class as part of the Chain of Responsibility pattern.

- External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Behavioral-Pattern-Usage}
- External Chain of Responsibility Pattern documentation: U{https://en.wikipedia.org/wiki/Chain-of-responsibility_pattern}

Instance Methods [hide private]
 
__init__(self, chainlink)
Initialize a new Chain instance.
source code
 
handle(self, request)
Handle a request.
source code
 
fail(self)
The method to call when the chain could not handle a request.
source code
Method Details [hide private]

__init__(self, chainlink)
(Constructor)

source code 

Initialize a new Chain instance.

Parameters:
  • chainlink - The starting chain link.

handle(self, request)

source code 

Handle a request.

Parameters:
  • request - The request to handle.

fail(self)

source code 

The method to call when the chain could not handle a request.

Decorators:
  • @abstractmethod