projects
/
graph.njae.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
c9d83b16c6d1ea152a36a77caaf38d7318be7ffa
[graph.njae.git]
/
lib
/
graph
/
graph.rb
1
require
'ostruct'
2
3
module
Graph
4
class
Graph
<
OpenStruct
5
def
initialize
6
super
7
self
.
edges
=
Array
.
new
8
self
.
vertices
=
Array
.
new
9
self
10
end
11
12
def
<<(
other
)
13
if
other
.
class
==
Vertex
14
self
.
vertices
<<
other
15
elsif
16
self
.
edges
<<
other
17
end
18
self
19
end
20
end
21
end