Results for: "Logger"

No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available

Loads the given certificate_file

Returns a new array containing only those elements from self that are not found in any of the given 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]
[0, 1, 2].difference                        # => [0, 1, 2]

Returns a copy of self if no arguments are given.

Related: Array#-; see also Methods for Combining.

Returns a new array containing each element in self that is eql? to at least one element in each of the given other_arrays; duplicates are omitted:

[0, 0, 1, 1, 2, 3].intersection([0, 1, 2], [0, 1, 3]) # => [0, 1]

Each element must correctly implement method hash.

Order from self is preserved:

[0, 1, 2].intersection([2, 1, 0]) # => [0, 1, 2]

Returns a copy of self if no arguments are given.

Related: see Methods for Combining.

Returns whether other_array has at least one element that is eql? to some element of self:

[1, 2, 3].intersect?([3, 4, 5]) # => true
[1, 2, 3].intersect?([4, 5, 6]) # => false

Each element must correctly implement method hash.

Related: see Methods for Querying.

Inserts the given objects as elements of self; returns self.

When index is non-negative, inserts objects before the element at offset index:

a = ['a', 'b', 'c']     # => ["a", "b", "c"]
a.insert(1, :x, :y, :z) # => ["a", :x, :y, :z, "b", "c"]

Extends the array if index is beyond the array (index >= self.size):

a = ['a', 'b', 'c']     # => ["a", "b", "c"]
a.insert(5, :x, :y, :z) # => ["a", "b", "c", nil, nil, :x, :y, :z]

When index is negative, inserts objects after the element at offset index + self.size:

a = ['a', 'b', 'c']      # => ["a", "b", "c"]
a.insert(-2, :x, :y, :z) # => ["a", "b", :x, :y, :z, "c"]

With no objects given, does nothing:

a = ['a', 'b', 'c'] # => ["a", "b", "c"]
a.insert(1)         # => ["a", "b", "c"]
a.insert(50)        # => ["a", "b", "c"]
a.insert(-50)       # => ["a", "b", "c"]

Raises IndexError if objects are given and index is negative and out of range.

Related: see Methods for Assigning.

Returns a new array containing the elements of self in reverse order:

[0, 1, 2].reverse # => [2, 1, 0]

Related: see Methods for Combining.

Reverses the order of the elements of self; returns self:

a = [0, 1, 2]
a.reverse! # => [2, 1, 0]
a          # => [2, 1, 0]

Related: see Methods for Assigning.

With a block given, calls the block with each element of self; returns a new array containing those elements of self for which the block returns a truthy value:

a = [:foo, 'bar', 2, :bam]
a.select {|element| element.to_s.start_with?('b') }
# => ["bar", :bam]

With no block given, returns a new Enumerator.

Related: see Methods for Fetching.

With a block given, calls the block with each element of self; removes from self those elements for which the block returns false or nil.

Returns self if any elements were removed:

a = [:foo, 'bar', 2, :bam]
a.select! {|element| element.to_s.start_with?('b') } # => ["bar", :bam]

Returns nil if no elements were removed.

With no block given, returns a new Enumerator.

Related: see Methods for Deleting.

Iterates over permutations of the elements of self; the order of permutations is indeterminate.

With a block and an in-range positive integer argument count (0 < count <= self.size) given, calls the block with each permutation of self of size count; returns self:

a = [0, 1, 2]
perms = []
a.permutation(1) {|perm| perms.push(perm) }
perms # => [[0], [1], [2]]

perms = []
a.permutation(2) {|perm| perms.push(perm) }
perms # => [[0, 1], [0, 2], [1, 0], [1, 2], [2, 0], [2, 1]]

perms = []
a.permutation(3) {|perm| perms.push(perm) }
perms # => [[0, 1, 2], [0, 2, 1], [1, 0, 2], [1, 2, 0], [2, 0, 1], [2, 1, 0]]

When count is zero, calls the block once with a new empty array:

perms = []
a.permutation(0) {|perm| perms.push(perm) }
perms # => [[]]

When count is out of range (negative or larger than self.size), does not call the block:

a.permutation(-1) {|permutation| fail 'Cannot happen' }
a.permutation(4) {|permutation| fail 'Cannot happen' }

With no block given, returns a new Enumerator.

Related: Methods for Iterating.

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 an integer that is a “floor” value for self, as specified by the given ndigits, which must be an integer-convertible object.

Related: Integer#ceil.

Returns self modulo other as a real number.

For integer n and real number r, these expressions are equivalent:

n % r
n-r*(n/r).floor
n.divmod(r)[1]

See Numeric#divmod.

Examples:

10 % 2              # => 0
10 % 3              # => 1
10 % 4              # => 2

10 % -2             # => 0
10 % -3             # => -2
10 % -4             # => -2

10 % 3.0            # => 1.0
10 % Rational(3, 1) # => (1/1)

Returns the remainder after dividing self by other.

Examples:

11.remainder(4)              # => 3
11.remainder(-4)             # => 3
-11.remainder(4)             # => -3
-11.remainder(-4)            # => -3

12.remainder(4)              # => 0
12.remainder(-4)             # => 0
-12.remainder(4)             # => 0
-12.remainder(-4)            # => 0

13.remainder(4.0)            # => 1.0
13.remainder(Rational(4, 1)) # => (1/1)

Returns true if self has a zero value, false otherwise.

Returns self.

Search took: 5ms  ·  Total Results: 2095