Class: UML::Graphviz::Edge

Inherits:
Object
  • Object
show all
Defined in:
lib/uml/graphviz_helper.rb

Direct Known Subclasses

Association, Dependency, Generalization

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tail, head) ⇒ Edge

Returns a new instance of Edge.



77
78
79
80
81
# File 'lib/uml/graphviz_helper.rb', line 77

def initialize(tail, head)
  @tail = tail
  @head = head
  @attributes = Attributes.new
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



75
76
77
# File 'lib/uml/graphviz_helper.rb', line 75

def attributes
  @attributes
end

Instance Method Details

#to_dot(indent = 0) ⇒ Object



83
84
85
# File 'lib/uml/graphviz_helper.rb', line 83

def to_dot(indent = 0)
  "#{'  ' * indent}#{Graph::name_to_id(@tail)} -> #{Graph::name_to_id(@head)} #{@attributes.to_dot};"
end