Results for: "match"

The iterator version of the tsort method. obj.tsort_each is similar to obj.tsort.each, but modification of obj during the iteration may lead to unexpected results.

tsort_each returns nil. If there is a cycle, TSort::Cyclic is raised.

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.tsort_each {|n| p n }
#=> 4
#   2
#   3
#   1

The iterator version of the TSort.tsort 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.tsort_each(each_node, each_child) {|n| p n }
#=> 4
#   2
#   3
#   1
No documentation available
No documentation available
No documentation available
No documentation available

@visibility private

Creates a new DH instance from scratch by generating the private and public components alike.

Parameters

Indicates whether this DH instance has a private key associated with it or not. The private key may be retrieved with DH#priv_key.

A description of the current connection state.

Calls block once for each element in self, passing that element as parameter asn1. If no block is given, an enumerator is returned instead.

Example

asn1_ary.each do |asn1|
  puts asn1
end

Returns the challenge string associated with this SPKI.

Parameters

Sets the challenge to be associated with the SPKI. May be used by the server, e.g. to prevent replay.

Creates an OpenSSL::OCSP::Response from status and basic_response.

Returns the status of the response.

Returns an Array of statuses for this response. Each status contains a CertificateId, the status (0 for good, 1 for revoked, 2 for unknown), the reason for the status, the revocation time, the time of this update, the time for the next update and a list of OpenSSL::X509::Extensions.

Creates a new DSA instance by generating a private/public key pair from scratch.

Parameters

Indicates whether this DSA instance has a private key associated with it or not. The private key may be retrieved with DSA#private_key.

Generates an RSA keypair. size is an integer representing the desired key size. Keys smaller than 1024 should be considered insecure. exponent is an odd number normally 3, 17, or 65537.

Does this keypair contain a private key?

No documentation available
No documentation available

Iterate over each node in the tree. Yields each node to block depth first.

No documentation available
No documentation available
Search took: 5ms  ·  Total Results: 2033