injectify.api   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A inject() 0 15 1
1
"""This module contains the apis that power Injectify."""
2
3
4
def inject(target, injector):
5
    """A decorator that injects code in the target object.
6
7
    Args:
8
        target: The object to inject code into.
9
        injector: A :class:`~injectify.injectors.BaseInjector` to represent an
10
            injection point.
11
    """
12
13
    def decorator(f):
14
        injector.prepare(target=target, handler=f)
15
        injector.compile(injector.visit_target())
16
        return f
17
18
    return decorator
19