Sha256: 5e7cb3db5b31675bf88129a1a163fe9ad4b1b10a5090cc1925aeced99f7ef427

Contents?: true

Size: 348 Bytes

Versions: 15

Compression:

Stored size: 348 Bytes

Contents

require 'tangle/edge'

module Tangle
  module Simple
    #
    # An edge in a simple graph, with no loops or multiedges
    #
    class Edge < Tangle::Edge
      private

      def validate_edge
        super
        raise LoopError unless @vertices.count == 2
        raise MultiEdgeError if @graph.edges.include? self
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
tangle-0.7.0 lib/tangle/simple/edge.rb
tangle-0.6.5 lib/tangle/simple/edge.rb
tangle-0.6.4 lib/tangle/simple/edge.rb
tangle-0.6.3 lib/tangle/simple/edge.rb
tangle-0.6.2 lib/tangle/simple/edge.rb
tangle-0.6.1 lib/tangle/simple/edge.rb
tangle-0.6.0 lib/tangle/simple/edge.rb
tangle-0.5.1 lib/tangle/simple/edge.rb
tangle-0.5.0 lib/tangle/simple/edge.rb
tangle-0.4.2 lib/tangle/simple/edge.rb
tangle-0.4.0 lib/tangle/simple/edge.rb
tangle-0.3.1 lib/tangle/simple/edge.rb
tangle-0.3.0 lib/tangle/simple/edge.rb
tangle-0.2.1 lib/tangle/simple/edge.rb
tangle-0.2.0 lib/tangle/simple/edge.rb