class Tinydot::Edge

Public Class Methods

new(from, to, attrs = {}) click to toggle source
# File lib/tinydot/edge.rb, line 3
def initialize(from, to, attrs = {})
  @from = from
  @to = to
  @attrs = attrs
end

Public Instance Methods

to_dot() click to toggle source
# File lib/tinydot/edge.rb, line 9
def to_dot
  dot = "#{@from.name} -> #{@to.name}"
  dot += " [dir = both]" if @attrs[:dir] == "both"
  dot += ";"
end