Returns the public key associated with the SPKI
, an instance of OpenSSL::PKey
.
pub - the public key to be set for this instance
Sets the public key to be associated with the SPKI
, an instance of OpenSSL::PKey
. This should be the public key corresponding to the private key used for signing the SPKI
.
If the Request
specified to request the TSA certificate (Request#cert_requested = true), then this field contains the certificate of the timestamp authority.
Returns the timestamp policy object identifier of the policy this timestamp was created under. If status is GRANTED or GRANTED_WITH_MODS, this is never nil
.
id = token_info.policy_id puts id -> "1.2.3.4.5"
Allows to set the object identifier that represents the timestamp policy under which the server shall create the timestamp. This may be left nil
, implying that the timestamp server will issue the timestamp using some default policy.
request.policy_id = "1.2.3.4.5"
Returns the ‘short name’ of the object identifier that represents the timestamp policy under which the server shall create the timestamp.
Ensures that :SSLCertificate and :SSLPrivateKey have been provided or that a new certificate is generated with the other parameters provided.
Return the 2 dependency objects that conflicted
Enumerates trusted certificates.
Loads the given certificate_file
Returns a new Array containing only those elements from self
that are not found in any of the Arrays other_arrays
; items are compared using eql?
; order from self
is preserved:
[0, 1, 1, 2, 1, 1, 3, 1, 1].difference([1]) # => [0, 2, 3] [0, 1, 2, 3].difference([3, 0], [1, 3]) # => [2] [0, 1, 2].difference([4]) # => [0, 1, 2]
Returns a copy of self
if no arguments given.
Related: Array#-
.
Replaces the content of self
with the content of other_array
; returns self
:
a = [:foo, 'bar', 2] a.replace(['foo', :bar, 3]) # => ["foo", :bar, 3]
Returns an array with both a numeric
and a int
represented as Integer
objects or Float
objects.
This is achieved by converting numeric
to an Integer
or a Float
.
A TypeError
is raised if the numeric
is not an Integer
or a Float
type.
(0x3FFFFFFFFFFFFFFF+1).coerce(42) #=> [42, 4611686018427387904]
Returns the smallest number greater than or equal to self
with a precision of ndigits
decimal digits.
When the precision is negative, the returned value is an integer with at least ndigits.abs
trailing zeros:
555.ceil(-1) # => 560 555.ceil(-2) # => 600 -555.ceil(-2) # => -500 555.ceil(-3) # => 1000
Returns self
when ndigits
is zero or positive.
555.ceil # => 555 555.ceil(50) # => 555
Related: Integer#floor
.
Returns the result of division self
by other
. The result is rounded up to the nearest integer.
3.ceildiv(3) # => 1 4.ceildiv(3) # => 2 4.ceildiv(-3) # => -1 -4.ceildiv(3) # => -1 -4.ceildiv(-3) # => 2 3.ceildiv(1.2) # => 3
Returns the value as a rational. The optional argument eps
is always ignored.
Returns the value as a rational if possible (the imaginary part should be exactly zero).
Complex(1.0/3, 0).rationalize #=> (1/3) Complex(1, 0.0).rationalize # RangeError Complex(1, 2).rationalize # RangeError
See to_r.
Returns zero as a rational. The optional argument eps
is always ignored.
Returns a 2-element array containing two numeric elements, formed from the two operands self
and other
, of a common compatible type.
Of the Core and Standard Library classes, Integer
, Rational
, and Complex
use this implementation.
Examples:
i = 2 # => 2 i.coerce(3) # => [3, 2] i.coerce(3.0) # => [3.0, 2.0] i.coerce(Rational(1, 2)) # => [0.5, 2.0] i.coerce(Complex(3, 4)) # Raises RangeError. r = Rational(5, 2) # => (5/2) r.coerce(2) # => [(2/1), (5/2)] r.coerce(2.0) # => [2.0, 2.5] r.coerce(Rational(2, 3)) # => [(2/3), (5/2)] r.coerce(Complex(3, 4)) # => [(3+4i), ((5/2)+0i)] c = Complex(2, 3) # => (2+3i) c.coerce(2) # => [(2+0i), (2+3i)] c.coerce(2.0) # => [(2.0+0i), (2+3i)] c.coerce(Rational(1, 2)) # => [((1/2)+0i), (2+3i)] c.coerce(Complex(3, 4)) # => [(3+4i), (2+3i)]
Raises an exception if any type conversion fails.
Returns the smallest number that is greater than or equal to self
with a precision of digits
decimal digits.
Numeric implements this by converting self
to a Float
and invoking Float#ceil
.
Splits str
into an array of tokens in the same way the UNIX Bourne shell does.
See Shellwords.shellsplit
for details.
Replaces the contents of self
with the contents of other_string
:
s = 'foo' # => "foo" s.replace('bar') # => "bar"
Returns a string containing the characters in self
; the first character is upcased; the remaining characters are downcased:
s = 'hello World!' # => "hello World!" s.capitalize # => "Hello world!"
The casing may be affected by the given options
; see Case Mapping.
Related: String#capitalize!
.