magneticalc.ConditionalDecorator.ConditionalDecorator

# ``magneticalc`.`ConditionalDecorator`.`ConditionalDecorator``

class documentation

`class ConditionalDecorator(object):`

Constructor: `ConditionalDecorator(condition, decorating_func, **decorating_args)`

View In Hierarchy

ConditionalDecorator class.

Method | `__call__` | Gets called when a function is to be decorated.
Method | `__init__` | Initializes a conditional decorator.
Instance Variable | `condition` | Undocumented
Instance Variable | `decorating_args` | Undocumented
Instance Variable | `decorating_func` | Undocumented

def __call__(self, func: `Callable`) -> `Callable`:

Gets called when a function is to be decorated.

Parameters
func: `Callable` | Function to be decorated

Returns
`Callable` | Decorated function

def __init__(self, condition: `bool`, decorating_func: `Callable`, **decorating_args: `Any`):

Initializes a conditional decorator.

Parameters
condition: `bool` | Condition
decorating_func: `Callable` | Decorating function
**decorating_args: `Any` | Arguments to decorating function

condition =

Undocumented

decorating_args =

Undocumented

decorating_func =

Undocumented