aboutsummaryrefslogtreecommitdiffstats
path: root/vicn/core/attribute.py
diff options
context:
space:
mode:
Diffstat (limited to 'vicn/core/attribute.py')
-rw-r--r--vicn/core/attribute.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/vicn/core/attribute.py b/vicn/core/attribute.py
index 22f44487..3afe0d6e 100644
--- a/vicn/core/attribute.py
+++ b/vicn/core/attribute.py
@@ -267,3 +267,16 @@ class Reference:
def __init__(self, resource, attribute=None):
self._resource = resource
self._attribute = attribute
+
+ def get_proxy(self):
+ if self._resource is Self:
+ resource = getattr(self, self._attribute)
+ else:
+ resource = getattr(self._resource, self._attribute)
+ return resource
+
+ def get(self, attribute_name):
+ return self.get_proxy().get(attribute_name)
+
+ def __iter__(self):
+ return iter(self.get_proxy())