projects
/
graph.njae.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Try to delete the *~ files again
[graph.njae.git]
/
lib
/
graph
/
graph.rb
diff --git
a/lib/graph/graph.rb
b/lib/graph/graph.rb
index c9d83b16c6d1ea152a36a77caaf38d7318be7ffa..25c95cc590142f2e55d76723a7a377a0dd8f4038 100644
(file)
--- a/
lib/graph/graph.rb
+++ b/
lib/graph/graph.rb
@@
-1,6
+1,11
@@
require 'ostruct'
require 'ostruct'
+# A simple graph library
+
module Graph
module Graph
+
+ # A container for all the parts of a graph. The graph can have arbitrary attributes,
+ # treated as method names.
class Graph < OpenStruct
def initialize
super
class Graph < OpenStruct
def initialize
super
@@
-9,6
+14,7
@@
module Graph
self
end
self
end
+ # Add a Vertex or Edge to the graph.
def <<(other)
if other.class == Vertex
self.vertices << other
def <<(other)
if other.class == Vertex
self.vertices << other