Class: DotR::Connection
Overview
Represents a connection between two nodes in a digraph. Instances of this class are created by calling Digraph#connection or Node#connection.
Specify styles on this object by setting instance attributes. Possible attributes include ‘label’ and ‘shape’; the attribute names and possible values correspond to the style attributes described in the ‘dot’ manual.
Instance Attribute Summary collapse
-
#from_name ⇒ Object
readonly
Returns the value of attribute from_name.
-
#to_name ⇒ Object
readonly
Returns the value of attribute to_name.
Instance Method Summary collapse
-
#initialize(from_name, to_name, style = {}) {|_self| ... } ⇒ Connection
constructor
:nodoc:.
-
#render_to(output_lines, indent) ⇒ Object
:nodoc:.
Methods included from Styled
Constructor Details
#initialize(from_name, to_name, style = {}) {|_self| ... } ⇒ Connection
:nodoc:
157 158 159 160 161 162 |
# File 'lib/dotr.rb', line 157 def initialize(from_name, to_name, style={}, &block) #:nodoc: @from_name = from_name @to_name = to_name style_attrs.update(style) yield self if block end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class DotR::Styled
Instance Attribute Details
#from_name ⇒ Object (readonly)
Returns the value of attribute from_name.
155 156 157 |
# File 'lib/dotr.rb', line 155 def from_name @from_name end |
#to_name ⇒ Object (readonly)
Returns the value of attribute to_name.
155 156 157 |
# File 'lib/dotr.rb', line 155 def to_name @to_name end |
Instance Method Details
#render_to(output_lines, indent) ⇒ Object
:nodoc:
164 165 166 |
# File 'lib/dotr.rb', line 164 def render_to(output_lines, indent) # :nodoc: output_lines << "#{indent}\"#{from_name}\" -> \"#{to_name}\"" + style + ";" end |