Initial commit
[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