| Class | RDoc::DOT::Node |
| In: |
dot.rb
doc-tmp/rdoc/dot.rb |
| Parent: | Element |
# 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
# 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
# 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
# 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