class Graphviz::Edge

Represents a visual edge between two nodes.

Attributes

attributes[RW]

@return [Hash] Any attributes specified for this edge.

destination[R]

@return [Node] The destination node.

source[R]

@return [Node] The source node.

Public Class Methods

new(graph, source, destination, attributes = {}) click to toggle source

Initialize the edge in the given graph, with a source and destination node. @param attributes [Hash] The associated graphviz attributes for this edge.

# File lib/graphviz/edge.rb, line 28
def initialize(graph, source, destination, attributes = {})
        @graph = graph
        @graph.edges << self
        
        @source = source
        @destination = destination
        
        @attributes = attributes
end

Public Instance Methods

to_s() click to toggle source

@return [String] A convenient ASCII arrow.

# File lib/graphviz/edge.rb, line 48
def to_s
        "#{@source} -> #{@destination}"
end