eric6/Graphics/ClassItem.py

changeset 8291
3d79b1e5bf3c
parent 8287
30eb7bc13d63
child 8295
3f5e8b0a338e
diff -r 6970128e3d71 -r 3d79b1e5bf3c eric6/Graphics/ClassItem.py
--- a/eric6/Graphics/ClassItem.py	Wed May 05 17:29:41 2021 +0200
+++ b/eric6/Graphics/ClassItem.py	Wed May 05 18:17:24 2021 +0200
@@ -389,3 +389,19 @@
         self.__calculateSize()
         
         return True
+    
+    def toDict(self):
+        """
+        Public method to collect data to be persisted.
+        
+        @return dictionary containing data to be persisted
+        @rtype dict
+        """
+        return {
+            "is_external": self.external,
+            "no_attributes": self.noAttrs,
+            "name": self.model.getName(),
+            "attributes": self.model.getInstanceAttributes(),
+            "methods": self.model.getMethods(),
+            "class_attributes": self.model.getClassAttributes(),
+        }

eric ide

mercurial