projects
/
graph.njae.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Version bump to 0.3.0
[graph.njae.git]
/
lib
/
graph.njae
/
vertex.rb
diff --git
a/lib/graph.njae/vertex.rb
b/lib/graph.njae/vertex.rb
index 6b34351740c04c0754a5e431f1ea38bd7773a0a0..6e46dcb40029aef8ceca16ad5c5ea2fc5a789c46 100644
(file)
--- a/
lib/graph.njae/vertex.rb
+++ b/
lib/graph.njae/vertex.rb
@@
-14,11
+14,11
@@
module GraphNjae
# Connect this vertex to another, creating an Edge to do so, and returning
# the Edge
# 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
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
@@
-39,5
+39,9
@@
module GraphNjae
e.vertices.drop_while {|v| v != self}[1..-1]}.flatten
end
e.vertices.drop_while {|v| v != self}[1..-1]}.flatten
end
+ def to_s
+ '<V: ' + self.name + '>'
+ end
+
end
end
end
end