Class DOT::DOTElement
In: dot/dot.rb
Parent: DOTSimpleElement

an element that has options ( node, edge or graph )

Methods

Attributes

name  [RW]  attr_reader :parent
options  [RW]  attr_reader :parent

Public Class methods

[Source]

     # File dot/dot.rb, line 97
 97:         def initialize( params = {}, option_list = [] )
 98:             super( params )
 99:             @name = params['name'] ? params['name'] : nil
100:             @parent = params['parent'] ? params['parent'] : nil
101:             @options = {}
102:             option_list.each{ |i|
103:                 @options[i] = params[i] if params[i]
104:             }
105:             @options['label'] ||= @name if @name != 'node'
106:         end

Public Instance methods

[Source]

     # File dot/dot.rb, line 108
108:         def each_option
109:             @options.each{ |i| yield i }
110:         end

[Source]

     # File dot/dot.rb, line 112
112:         def each_option_pair
113:             @options.each_pair{ |key, val| yield key, val }
114:         end

[Validate]