Class RDoc::DOT::Node
In: dot.rb
doc-tmp/rdoc/dot.rb
Parent: Element

node element

Methods

<<   <<   each_port   each_port   new   new   pop   pop   push   push   to_s   to_s  

Public Class methods

[Source]

     # File dot.rb, line 135
135:     def initialize( params = {}, option_list = NODE_OPTS )
136:       super( params, option_list )
137:       @ports = params['ports'] ? params['ports'] : []
138:     end

[Source]

     # File doc-tmp/rdoc/dot.rb, line 135
135:     def initialize( params = {}, option_list = NODE_OPTS )
136:       super( params, option_list )
137:       @ports = params['ports'] ? params['ports'] : []
138:     end

Public Instance methods

[Source]

     # File dot.rb, line 144
144:     def << ( thing )
145:       @ports << thing
146:     end

[Source]

     # File doc-tmp/rdoc/dot.rb, line 144
144:     def << ( thing )
145:       @ports << thing
146:     end

[Source]

     # File dot.rb, line 140
140:     def each_port
141:       @ports.each{ |i| yield i }
142:     end

[Source]

     # File doc-tmp/rdoc/dot.rb, line 140
140:     def each_port
141:       @ports.each{ |i| yield i }
142:     end

[Source]

     # File doc-tmp/rdoc/dot.rb, line 152
152:     def pop
153:       @ports.pop
154:     end

[Source]

     # File dot.rb, line 152
152:     def pop
153:       @ports.pop
154:     end

[Source]

     # File dot.rb, line 148
148:     def push ( thing )
149:       @ports.push( thing )
150:     end

[Source]

     # File doc-tmp/rdoc/dot.rb, line 148
148:     def push ( thing )
149:       @ports.push( thing )
150:     end

[Source]

     # File dot.rb, line 156
156:     def to_s( t = '' )
157: 
158:       label = @options['shape'] != 'record' && @ports.length == 0 ?
159:         @options['label'] ?
160:         t + TAB + "label = \"#{@options['label']}\"\n" :
161:                     '' :
162:                     t + TAB + 'label = "' + " \\\n" +
163:                     t + TAB2 + "#{@options['label']}| \\\n" +
164:                     @ports.collect{ |i|
165:         t + TAB2 + i.to_s
166:       }.join( "| \\\n" ) + " \\\n" +
167:         t + TAB + '"' + "\n"
168: 
169:         t + "#{@name} [\n" +
170:         @options.to_a.collect{ |i|
171:         i[1] && i[0] != 'label' ?
172:           t + TAB + "#{i[0]} = #{i[1]}" : nil
173:       }.compact.join( ",\n" ) + ( label != '' ? ",\n" : "\n" ) +
174:         label +
175:         t + "]\n"
176:     end

[Source]

     # File doc-tmp/rdoc/dot.rb, line 156
156:     def to_s( t = '' )
157: 
158:       label = @options['shape'] != 'record' && @ports.length == 0 ?
159:         @options['label'] ?
160:         t + TAB + "label = \"#{@options['label']}\"\n" :
161:                     '' :
162:                     t + TAB + 'label = "' + " \\\n" +
163:                     t + TAB2 + "#{@options['label']}| \\\n" +
164:                     @ports.collect{ |i|
165:         t + TAB2 + i.to_s
166:       }.join( "| \\\n" ) + " \\\n" +
167:         t + TAB + '"' + "\n"
168: 
169:         t + "#{@name} [\n" +
170:         @options.to_a.collect{ |i|
171:         i[1] && i[0] != 'label' ?
172:           t + TAB + "#{i[0]} = #{i[1]}" : nil
173:       }.compact.join( ",\n" ) + ( label != '' ? ",\n" : "\n" ) +
174:         label +
175:         t + "]\n"
176:     end

[Validate]