Class DOT::DOTSubgraph
In: rdoc/dot/dot.rb
Parent: DOTElement

subgraph element is the same to graph, but has another header in dot notation

Methods

<<   each_node   new   pop   push   to_s  

Public Class methods

[Source]

# File rdoc/dot/dot.rb, line 188
        def initialize( params = {}, option_list = GRAPH_OPTS )
            super( params, option_list )
            @nodes = params['nodes'] ? params['nodes'] : []
            @dot_string = 'subgraph'
        end

Public Instance methods

[Source]

# File rdoc/dot/dot.rb, line 198
        def << ( thing )
            @nodes << thing
        end

[Source]

# File rdoc/dot/dot.rb, line 194
        def each_node
            @nodes.each{ |i| yield i }
        end

[Source]

# File rdoc/dot/dot.rb, line 206
        def pop
            @nodes.pop
        end

[Source]

# File rdoc/dot/dot.rb, line 202
        def push( thing )
            @nodes.push( thing )
        end

[Source]

# File rdoc/dot/dot.rb, line 210
        def to_s( t = '' )
          hdr = t + "#{@dot_string} #{@name} {\n"

          options = @options.to_a.collect{ |name, val|
            val && name != 'label' ?
            t + $tab + "#{name} = #{val}" :
              name ? t + $tab + "#{name} = \"#{val}\"" : nil
          }.compact.join( "\n" ) + "\n"

          nodes = @nodes.collect{ |i|
            i.to_s( t + $tab )
          }.join( "\n" ) + "\n"
          hdr + options + nodes + t + "}\n"
        end

[Validate]

ruby-doc.org is hosted and maintained by James Britt and Happy Camper Studios, a Ruby application development company in Phoenix, Arizona. The site was created in 2002 as part of the Ruby Documentation Project to promote the Ruby language and to help other Ruby hackers.

Documentation content on ruby-doc.org is provided by remarkable members of the Ruby community.

For more information on the Ruby programming language, visit ruby-lang.org.

Want to help improve Ruby's API docs? See Ruby Documentation Guidelines.