Class: Accessibility::Graph::Edge
- Inherits:
-
Object
- Object
- Accessibility::Graph::Edge
- Defined in:
- lib/accessibility/graph.rb
Overview
An edge in the UI hierarchy. Used by Accessibility::Graph in order to build Graphviz DOT graphs.
Instance Attribute Summary collapse
-
#style ⇒ String
The style of arrowhead to use.
Instance Method Summary collapse
-
#initialize(head, tail) ⇒ Edge
constructor
A new instance of Edge.
- #to_dot ⇒ String
Constructor Details
#initialize(head, tail) ⇒ Edge
Returns a new instance of Edge.
137 138 139 |
# File 'lib/accessibility/graph.rb', line 137 def initialize head, tail @head, @tail = head, tail end |
Instance Attribute Details
#style ⇒ String
The style of arrowhead to use
133 134 135 |
# File 'lib/accessibility/graph.rb', line 133 def style @style end |
Instance Method Details
#to_dot ⇒ String
142 143 144 145 |
# File 'lib/accessibility/graph.rb', line 142 def to_dot arrow = style ? style : 'normal' "#{@head.id} -> #{@tail.id} [arrowhead = #{arrow}]" end |