projects
/
graph.njae.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Resolved merge issues
[graph.njae.git]
/
lib
/
graph.njae
/
vertex.rb
diff --git
a/lib/graph.njae/vertex.rb
b/lib/graph.njae/vertex.rb
index 4a75b6df2c628c0cba8a25fead7aff670a1c1563..aeabe30559be5f1f0a4cf1acf19a7607ff6a1249 100644
(file)
--- a/
lib/graph.njae/vertex.rb
+++ b/
lib/graph.njae/vertex.rb
@@
-6,8
+6,8
@@
module GraphNjae
# A vertex in a graph. The edge can have arbitrary attributes,treated as
# method names.
class Vertex < OpenStruct
# 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
self.edges = []
self
end
@@
-17,8
+17,8
@@
module GraphNjae
def connect(other)
e = Edge.new
e << self << other
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
e
end