Extended maintenance of Ruby versions 1.8.7 and 1.9.2 will end on July 31, 2014. Read more

In Files

  • rdoc/dot/dot.rb

Files

Class/Module Index [+]

Quicksearch

DOT::DOTSubgraph

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

Public Class Methods

new( params = {}, option_list = GRAPH_OPTS ) click to toggle 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

<<( thing ) click to toggle source
 
               # File rdoc/dot/dot.rb, line 198
def << ( thing )
    @nodes << thing
end
            
each_node() click to toggle source
 
               # File rdoc/dot/dot.rb, line 194
def each_node
    @nodes.each{ |i| yield i }
end
            
pop() click to toggle source
 
               # File rdoc/dot/dot.rb, line 206
def pop
    @nodes.pop
end
            
push( thing ) click to toggle source
 
               # File rdoc/dot/dot.rb, line 202
def push( thing )
    @nodes.push( thing )
end
            
to_s( t = '' ) click to toggle 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
            

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.

blog comments powered by Disqus