End of the day
[graph.njae.git] / lib / graph.njae / vertex.rb
index aeabe30559be5f1f0a4cf1acf19a7607ff6a1249..6e46dcb40029aef8ceca16ad5c5ea2fc5a789c46 100644 (file)
@@ -14,8 +14,8 @@ module GraphNjae
     
     # Connect this vertex to another, creating an Edge to do so, and returning
     # the Edge
-    def connect(other)
-      e = Edge.new
+    def connect(other, edge_attributes = {})
+      e = Edge.new edge_attributes
       e << self << other
       # self.edges << e
       # other.edges << e unless self === other
@@ -39,5 +39,9 @@ module GraphNjae
                       e.vertices.drop_while {|v| v != self}[1..-1]}.flatten
     end
     
+    def to_s
+      '<V: ' + self.name + '>'
+    end
+    
   end
 end