diff options
author | Martin Sivak <msivak@redhat.com> | 2013-03-22 13:55:13 +0100 |
---|---|---|
committer | Martin Sivak <msivak@redhat.com> | 2013-03-22 13:55:13 +0100 |
commit | b53c7a4b173fe7a533bb681bc5d2be47f061d9b9 (patch) | |
tree | cae912943b2395a051afe852483981c64957d1ae | |
parent | 92a191db2f0b3fd851266771cb32203c89a89ecc (diff) | |
download | python-di-b53c7a4b173fe7a533bb681bc5d2be47f061d9b9.tar.gz python-di-b53c7a4b173fe7a533bb681bc5d2be47f061d9b9.tar.xz python-di-b53c7a4b173fe7a533bb681bc5d2be47f061d9b9.zip |
Rename the register method to _inject_
-rw-r--r-- | di/core.py | 4 | ||||
-rw-r--r-- | di/core_test.py | 2 |
2 files changed, 3 insertions, 3 deletions
@@ -67,7 +67,7 @@ class DiRegistry(object): """Support instance methods.""" return partial(self.__call__, obj) - def register(self, *args, **kwargs): + def _inject_(self, *args, **kwargs): """Add registered injections to the instance of DiRegistry """ self.__used_objects.update(kwargs) @@ -146,7 +146,7 @@ def inject(*args, **kwargs): if not isinstance(obj, DiRegistry): obj = DiRegistry(obj) - obj.register(*args, **kwargs) + obj._inject_(*args, **kwargs) return obj return inject_decorate diff --git a/di/core_test.py b/di/core_test.py index 6e99612..828df37 100644 --- a/di/core_test.py +++ b/di/core_test.py @@ -95,7 +95,7 @@ class ClassDITestCase(unittest.TestCase): def test_named_register(self): """Test injection to instance method.""" - Test.register(method_to_inject) + Test._inject_(method_to_inject) def test_class_init_inject(self): """Test injection to class constructor.""" |