Class RDoc::DOT::Node

  1. lib/rdoc/dot.rb
ClassModule NormalModule AnonClass SingleClass NormalClass AnyMethod GhostMethod MetaMethod CodeObject Context Alias Attr Constant Require Include TopLevel RubyLex IRB RuntimeError Error Error Token TkUnknownChar TkVal TkNode TkOp TkId TkError TkOPASGN TkKW AttributeFormatter HtmlFormatter OverstrikeFormatter AnsiFormatter NamedThing AliasName IncludedModule Constant Attribute MethodSummary DefaultDisplay ClassEntry TopLevelEntry Formatter SimpleFormatter Description MethodDescription ModuleDescription ClassDescription HTML XML HTMLInOne CHM Method Context Class File Generator::MarkUp TEXINFO SimpleElement Port Element Node Subgraph Edge Digraph Stats Parser Options RDoc TemplatePage Markup Diagram NameDescriptor Cache Reader Writer Driver MethodEntry RI TexinfoTemplate AllReferences RubyToken Display Paths RI MarkUp Generator TokenStream DOT RDoc dot/f_5.png

node element

Methods

public class

  1. new

public instance

  1. <<
  2. each_port
  3. pop
  4. push
  5. to_s

Public class methods

new ( params = {}, option_list = NODE_OPTS )
[show source]
# File lib/rdoc/dot.rb, line 135
    def initialize( params = {}, option_list = NODE_OPTS )
      super( params, option_list )
      @ports = params['ports'] ? params['ports'] : []
    end

Public instance methods

<< ( thing )
[show source]
# File lib/rdoc/dot.rb, line 144
    def << ( thing )
      @ports << thing
    end
each_port () {|i| ...}
[show source]
# File lib/rdoc/dot.rb, line 140
    def each_port
      @ports.each{ |i| yield i }
    end
pop ()
[show source]
# File lib/rdoc/dot.rb, line 152
    def pop
      @ports.pop
    end
push ( thing )
[show source]
# File lib/rdoc/dot.rb, line 148
    def push ( thing )
      @ports.push( thing )
    end
to_s ( t = '' )
[show source]
# File lib/rdoc/dot.rb, line 156
    def to_s( t = '' )

      label = @options['shape'] != 'record' && @ports.length == 0 ?
        @options['label'] ?
        t + TAB + "label = \"#{@options['label']}\"\n" :
                    '' :
                    t + TAB + 'label = "' + " \\\n" +
                    t + TAB2 + "#{@options['label']}| \\\n" +
                    @ports.collect{ |i|
        t + TAB2 + i.to_s
      }.join( "| \\\n" ) + " \\\n" +
        t + TAB + '"' + "\n"

        t + "#{@name} [\n" +
        @options.to_a.collect{ |i|
        i[1] && i[0] != 'label' ?
          t + TAB + "#{i[0]} = #{i[1]}" : nil
      }.compact.join( ",\n" ) + ( label != '' ? ",\n" : "\n" ) +
        label +
        t + "]\n"
    end