Class | RDoc::DOT::Subgraph |
In: |
dot.rb
doc-tmp/rdoc/dot.rb |
Parent: | Element |
subgraph element is the same to graph, but has another header in dot notation
# File dot.rb, line 183 183: def initialize( params = {}, option_list = GRAPH_OPTS ) 184: super( params, option_list ) 185: @nodes = params['nodes'] ? params['nodes'] : [] 186: @dot_string = 'subgraph' 187: end
# File doc-tmp/rdoc/dot.rb, line 183 183: def initialize( params = {}, option_list = GRAPH_OPTS ) 184: super( params, option_list ) 185: @nodes = params['nodes'] ? params['nodes'] : [] 186: @dot_string = 'subgraph' 187: end
# File dot.rb, line 205 205: def to_s( t = '' ) 206: hdr = t + "#{@dot_string} #{@name} {\n" 207: 208: options = @options.to_a.collect{ |name, val| 209: val && name != 'label' ? 210: t + TAB + "#{name} = #{val}" : 211: name ? t + TAB + "#{name} = \"#{val}\"" : nil 212: }.compact.join( "\n" ) + "\n" 213: 214: nodes = @nodes.collect{ |i| 215: i.to_s( t + TAB ) 216: }.join( "\n" ) + "\n" 217: hdr + options + nodes + t + "}\n" 218: end
# File doc-tmp/rdoc/dot.rb, line 205 205: def to_s( t = '' ) 206: hdr = t + "#{@dot_string} #{@name} {\n" 207: 208: options = @options.to_a.collect{ |name, val| 209: val && name != 'label' ? 210: t + TAB + "#{name} = #{val}" : 211: name ? t + TAB + "#{name} = \"#{val}\"" : nil 212: }.compact.join( "\n" ) + "\n" 213: 214: nodes = @nodes.collect{ |i| 215: i.to_s( t + TAB ) 216: }.join( "\n" ) + "\n" 217: hdr + options + nodes + t + "}\n" 218: end