0201c84f97efdbddd18e147e9df5dda6e023743d
[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 end
10
11 def <<(other)
12 if other.class == Vertex
13 self.vertices << other
14 elsif
15 self.edges << other
16 end
17 self
18 end
19 end
20 end