Switch

Variable execution defined by input data

Subclass of Component.

Module: core

Methods and properties

Main methods and properties


__init__

Arguments:

  • *branches (Branch): Branches that will be used.

  • name (Optional[str], optional): Name for identification. If equals to None, class name will be used. Defaults to None.




Branch

Combination of condition and associated with it Component


__init__

Arguments:

  • schema (Component): Associated Component.

  • condition (Optional[ConditionProtocol], optional): Associated condition. If equals to None, schema always executed. Defaults to None.

  • exit_branch (bool, optional): Specifies that this is the last branch that should be executed. Defaults to True.

  • name (Optional[str], optional): Name for identification. If equals to None, class name will be used. Defaults to None.


__call__

Evaluates condition and, if fulfilled, executes schema

Arguments:

  • input_data (Transformable): Data for processing

  • evaluator (Optional[Evaluator], optional): Evaluator in context of which Condition executed.

Returns:

  • Optional[Transformable]: Result of executed schema, if executed; otherwise, None.



Last updated