Adds a nested object to the nyan object.
(self, new_nested_object: NyanObject)
| 83 | self._process_inheritance() |
| 84 | |
| 85 | def add_nested_object(self, new_nested_object: NyanObject) -> None: |
| 86 | """ |
| 87 | Adds a nested object to the nyan object. |
| 88 | """ |
| 89 | if not isinstance(new_nested_object, NyanObject): |
| 90 | raise TypeError("nested object must have <NyanObject> type") |
| 91 | |
| 92 | if new_nested_object is self: |
| 93 | raise ValueError( |
| 94 | "nyan object must not contain itself as nested object") |
| 95 | |
| 96 | self._nested_objects.add(new_nested_object) |
| 97 | |
| 98 | new_nested_object.set_fqon((*self._fqon, |
| 99 | new_nested_object.get_name())) |
| 100 | |
| 101 | def add_member(self, new_member: NyanMember) -> None: |
| 102 | """ |
no test coverage detected