Class: Graphviz::Edge
- Inherits:
-
Object
- Object
- Graphviz::Edge
- Defined in:
- lib/graphviz/graph.rb
Overview
Represents a visual edge between two nodes.
Instance Attribute Summary collapse
-
#attributes ⇒ Hash
Any attributes specified for this edge.
-
#destination ⇒ Node
readonly
The destination node.
-
#source ⇒ Node
readonly
The source node.
Instance Method Summary collapse
-
#initialize(graph, source, destination, attributes = {}) ⇒ Edge
constructor
Initialize the edge in the given graph, with a source and destination node.
-
#to_s ⇒ String
A convenient ASCII arrow.
Constructor Details
#initialize(graph, source, destination, attributes = {}) ⇒ Edge
Initialize the edge in the given graph, with a source and destination node.
77 78 79 80 81 82 83 84 85 |
# File 'lib/graphviz/graph.rb', line 77 def initialize(graph, source, destination, attributes = {}) @graph = graph @graph.edges << self @source = source @destination = destination @attributes = attributes end |
Instance Attribute Details
#attributes ⇒ Hash
Returns Any attributes specified for this edge.
94 95 96 |
# File 'lib/graphviz/graph.rb', line 94 def attributes @attributes end |
#destination ⇒ Node (readonly)
Returns The destination node.
91 92 93 |
# File 'lib/graphviz/graph.rb', line 91 def destination @destination end |
#source ⇒ Node (readonly)
Returns The source node.
88 89 90 |
# File 'lib/graphviz/graph.rb', line 88 def source @source end |
Instance Method Details
#to_s ⇒ String
Returns A convenient ASCII arrow.
97 98 99 |
# File 'lib/graphviz/graph.rb', line 97 def to_s '->' end |