The iterator version of the TSort.strongly_connected_components
method.
The graph is represented by each_node and each_child. each_node should have call
method which yields for each node in the graph. each_child should have call
method which takes a node argument and yields for each child node.
g = {1=>[2, 3], 2=>[4], 3=>[2, 4], 4=>[]} each_node = lambda {|&b| g.each_key(&b) } each_child = lambda {|n, &b| g[n].each(&b) } TSort.each_strongly_connected_component(each_node, each_child) {|scc| p scc } #=> [4] # [2] # [3] # [1] g = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]} each_node = lambda {|&b| g.each_key(&b) } each_child = lambda {|n, &b| g[n].each(&b) } TSort.each_strongly_connected_component(each_node, each_child) {|scc| p scc } #=> [4] # [2, 3] # [1]
Get the indentation level.
Set
the indentation level to level
. The level must be less than 10 and greater than 1.
A detailed description of this gem. See also summary
Create a DRbUnknownError
exception containing this object.
Issues an OPTS command
name Should be the name of the option to set
params is any optional parameters to supply with the option
example: option(‘UTF8’, ‘ON’) => ‘OPTS UTF8 ON’
Sends a OPTIONS request to the path
and gets a response, as an HTTPResponse
object.
This method returns a list of notations that have been declared in the internal DTD
subset. Notations in the external DTD
subset are not listed.
Method
contributed by Henrik Martensson
Retrieves a named notation. Only notations declared in the internal DTD
subset can be retrieved.
Method
contributed by Henrik Martensson
Override to display a longer description of what this command does.
Creates a class to wrap the C union described by signature
.
MyUnion = union ['int i', 'char c']
Generate a Table Caption element as a string.
align
can be a string, giving the alignment of the caption (one of top, bottom, left, or right). It can be a hash of all the attributes of the element. Or it can be omitted.
The body of the element is provided by the passed-in no-argument block.
caption("left") { "Capital Cities" } # => <CAPTION ALIGN=\"left\">Capital Cities</CAPTION>
Sets OptionParser
object, when opt
is false
or nil
, methods OptionParser::Arguable#options
and OptionParser::Arguable#options=
are undefined. Thus, there is no ways to access the OptionParser
object via the receiver object.
Actual OptionParser
object, automatically created if nonexistent.
If called with a block, yields the OptionParser
object and returns the result of the block. If an OptionParser::ParseError
exception occurs in the block, it is rescued, a error message printed to STDERR and nil
returned.