Set
the indentation level to level
. The level must be less than 10 and greater than 1.
Create a DRbUnknownError
exception containing this object.
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.
A detailed description of this gem. See also summary
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.
<!NOTATION …>
<!NOTATION …>
Starts tracing object allocations.
Stop tracing object allocations.
Note that if ::trace_object_allocations_start
is called n-times, then tracing will stop after calling ::trace_object_allocations_stop
n-times.
The iterator version of the strongly_connected_components
method. obj.each_strongly_connected_component
is similar to obj.strongly_connected_components.each
, but modification of obj during the iteration may lead to unexpected results.
each_strongly_connected_component
returns nil
.
class G include TSort def initialize(g) @g = g end def tsort_each_child(n, &b) @g[n].each(&b) end def tsort_each_node(&b) @g.each_key(&b) end end graph = G.new({1=>[2, 3], 2=>[4], 3=>[2, 4], 4=>[]}) graph.each_strongly_connected_component {|scc| p scc } #=> [4] # [2] # [3] # [1] graph = G.new({1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}) graph.each_strongly_connected_component {|scc| p scc } #=> [4] # [2, 3] # [1]
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]
Appends the elements of +other_ary+s to self
.
[ "a", "b" ].concat( ["c", "d"] ) #=> [ "a", "b", "c", "d" ] [ "a" ].concat( ["b"], ["c", "d"] ) #=> [ "a", "b", "c", "d" ] [ "a" ].concat #=> [ "a" ] a = [ 1, 2, 3 ] a.concat( [ 4, 5 ] ) a #=> [ 1, 2, 3, 4, 5 ] a = [ 1, 2 ] a.concat(a, a) #=> [1, 2, 1, 2, 1, 2]
See also Array#+
.