Product graphs working initially
[graph.njae.git] / lib / graph.njae / vertex.rb
index 4a75b6df2c628c0cba8a25fead7aff670a1c1563..aeabe30559be5f1f0a4cf1acf19a7607ff6a1249 100644 (file)
@@ -6,8 +6,8 @@ module GraphNjae
   # A vertex in a graph. The edge can have arbitrary attributes,treated as 
   # method names.
   class Vertex < OpenStruct
-    def initialize
-      super
+    def initialize(values = {})
+      super(values)
       self.edges = []
       self
     end
@@ -17,8 +17,8 @@ module GraphNjae
     def connect(other)
       e = Edge.new
       e << self << other
-      self.edges << e
-      other.edges << e unless self === other
+      self.edges << e
+      other.edges << e unless self === other
       e
     end