X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=lib%2Fgraph%2Fgraph.rb;fp=lib%2Fgraph%2Fgraph.rb;h=0000000000000000000000000000000000000000;hb=0908114d61c0effab6a568dd47053244df92cde8;hp=25c95cc590142f2e55d76723a7a377a0dd8f4038;hpb=7bd4317633966d7fcddff3b05767fcbf79a56ebf;p=graph.njae.git diff --git a/lib/graph/graph.rb b/lib/graph/graph.rb deleted file mode 100644 index 25c95cc..0000000 --- a/lib/graph/graph.rb +++ /dev/null @@ -1,27 +0,0 @@ -require 'ostruct' - -# A simple graph library - -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 - self.edges = Array.new - self.vertices = Array.new - self - end - - # Add a Vertex or Edge to the graph. - def <<(other) - if other.class == Vertex - self.vertices << other - elsif - self.edges << other - end - self - end - end -end