Class: DOT::DOTEdge
- Inherits:
-
DOTElement
- Object
- DOTSimpleElement
- DOTElement
- DOT::DOTEdge
- Defined in:
- lib/puppet/external/dot.rb
Overview
This is an edge.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#from ⇒ Object
Returns the value of attribute from.
-
#to ⇒ Object
Returns the value of attribute to.
Attributes inherited from DOTElement
Attributes inherited from DOTSimpleElement
Instance Method Summary collapse
- #edge_link ⇒ Object
-
#initialize(params = {}, option_list = EDGE_OPTS) ⇒ DOTEdge
constructor
A new instance of DOTEdge.
- #to_s(t = '') ⇒ Object
Methods inherited from DOTElement
#each_option, #each_option_pair
Constructor Details
#initialize(params = {}, option_list = EDGE_OPTS) ⇒ DOTEdge
Returns a new instance of DOTEdge.
288 289 290 291 292 |
# File 'lib/puppet/external/dot.rb', line 288 def initialize(params = {}, option_list = EDGE_OPTS) super(params, option_list) @from = params['from'] || nil @to = params['to'] || nil end |
Instance Attribute Details
#from ⇒ Object
Returns the value of attribute from.
286 287 288 |
# File 'lib/puppet/external/dot.rb', line 286 def from @from end |
#to ⇒ Object
Returns the value of attribute to.
286 287 288 |
# File 'lib/puppet/external/dot.rb', line 286 def to @to end |
Instance Method Details
#edge_link ⇒ Object
294 295 296 |
# File 'lib/puppet/external/dot.rb', line 294 def edge_link '--' end |
#to_s(t = '') ⇒ Object
298 299 300 301 302 303 304 305 306 307 |
# File 'lib/puppet/external/dot.rb', line 298 def to_s(t = '') t + "#{@from} #{edge_link} #{to} [\n" + @options.to_a.filter_map { |i| if i[1] && i[0] != 'label' t + $tab + "#{i[0]} = #{i[1]}" else i[1] ? t + $tab + "#{i[0]} = \"#{i[1]}\"" : nil end }.join("\n") + "\n#{t}]\n" end |