Class: Accessibility::Graph::Edge

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#styleString

The style of arrowhead to use

Returns:

  • (String)


133
134
135
# File 'lib/accessibility/graph.rb', line 133

def style
  @style
end

Instance Method Details

#to_dotString

Returns:

  • (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