Class: Tinydot::Edge
- Inherits:
-
Object
- Object
- Tinydot::Edge
- Defined in:
- lib/tinydot/edge.rb
Instance Method Summary collapse
-
#initialize(from, to, attrs = {}) ⇒ Edge
constructor
A new instance of Edge.
- #to_dot ⇒ Object
Constructor Details
#initialize(from, to, attrs = {}) ⇒ Edge
Returns a new instance of Edge.
3 4 5 6 7 |
# File 'lib/tinydot/edge.rb', line 3 def initialize(from, to, attrs = {}) @from = from @to = to @attrs = attrs end |
Instance Method Details
#to_dot ⇒ Object
9 10 11 12 13 |
# File 'lib/tinydot/edge.rb', line 9 def to_dot dot = "#{@from.name} -> #{@to.name}" dot += " [dir = both]" if @attrs[:dir] == "both" dot += ";" end |