Fiddling around with labels and boxes
[erd-marker.git] / lib / erd_handler / erd.rb
index bf740072d432b883cf7e58d891d56c4431418051..2c10364ef90983bbb74009d2d12d46eccea3e142 100644 (file)
@@ -22,5 +22,27 @@ module ErdHandler
       end
       self
     end
+    
+    # The minimal meaningful units of an ERD are:
+    #  Each box in isolation
+    #  Each link, with the associated boxes at its ends
+    def mmus
+      mmus = []
+      self.vertices.each do |b| 
+        mmu = Erd.new
+        mmu << b
+        mmus << mmu 
+      end
+      self.edges.each do |l| 
+        mmu = Erd.new
+        l.vertices.each do |b|
+          mmu << b
+        end
+        mmu << l
+        mmus << mmu
+      end
+      mmus
+    end
+    
   end
 end