Create a new AlternationPatternNode
node.
Creates a self-signed certificate with an issuer and subject from email
, a subject alternative name of email
and the given extensions
for the key
.
Deprecation method to deprecate Rubygems commands
Deprecation method to deprecate Rubygems commands
Fetch a value from the entry, raising an error if it is missing.
Verifies each certificate in chain
has signed the following certificate and is valid for the given time
.
Verifies that data
matches the signature
created by public_key
and the digest
algorithm.
Updates the TarHeader’s checksum
Enumerates trusted certificates.
Delegates to the wrapped source’s fetch_spec
method.
Returns the element of self
specified by the given index
or nil
if there is no such element; index
must be an integer-convertible object.
For non-negative index
, returns the element of self
at offset index
:
a = [:foo, 'bar', 2] a.at(0) # => :foo a.at(2) # => 2 a.at(2.0) # => 2
For negative index
, counts backwards from the end of self
:
a.at(-2) # => "bar"
Related: Array#[]
; see also Methods for Fetching.
Adds to self
all elements from each array in other_arrays
; returns self
:
a = [0, 1] a.concat(['two', 'three'], [:four, :five], a) # => [0, 1, "two", "three", :four, :five, 0, 1]
Related: see Methods for Assigning.
With a block given, iterates over the elements of self
, passing each element to the block; returns self
:
a = [:foo, 'bar', 2] a.each {|element| puts "#{element.class} #{element}" }
Output:
Symbol foo String bar Integer 2
Allows the array to be modified during iteration:
a = [:foo, 'bar', 2] a.each {|element| puts element; a.clear if element.to_s.start_with?('b') }
Output:
foo bar
With no block given, returns a new Enumerator
.
Related: see Methods for Iterating.
Returns a new array formed from self
with elements rotated from one end to the other.
With non-negative numeric count
, rotates elements from the beginning to the end:
[0, 1, 2, 3].rotate(2) # => [2, 3, 0, 1] [0, 1, 2, 3].rotate(2.1) # => [2, 3, 0, 1]
If count
is large, uses count % array.size
as the count:
[0, 1, 2, 3].rotate(22) # => [2, 3, 0, 1]
With a count
of zero, rotates no elements:
[0, 1, 2, 3].rotate(0) # => [0, 1, 2, 3]
With negative numeric count
, rotates in the opposite direction, from the end to the beginning:
[0, 1, 2, 3].rotate(-1) # => [3, 0, 1, 2]
If count
is small (far from zero), uses count % array.size
as the count:
[0, 1, 2, 3].rotate(-21) # => [3, 0, 1, 2]
Related: see Methods for Fetching.
Rotates self
in place by moving elements from one end to the other; returns self
.
With non-negative numeric count
, rotates count
elements from the beginning to the end:
[0, 1, 2, 3].rotate!(2) # => [2, 3, 0, 1] [0, 1, 2, 3].rotate!(2.1) # => [2, 3, 0, 1]
If count
is large, uses count % array.size
as the count:
[0, 1, 2, 3].rotate!(21) # => [1, 2, 3, 0]
If count
is zero, rotates no elements:
[0, 1, 2, 3].rotate!(0) # => [0, 1, 2, 3]
With a negative numeric count
, rotates in the opposite direction, from end to beginning:
[0, 1, 2, 3].rotate!(-1) # => [3, 0, 1, 2]
If count
is small (far from zero), uses count % array.size
as the count:
[0, 1, 2, 3].rotate!(-21) # => [3, 0, 1, 2]
Related: see Methods for Assigning.