$foo += bar ^^^^^^^^^^^
$foo &&= bar ^^^^^^^^^^^^
$foo ||= bar ^^^^^^^^^^^^
foo += bar ^^^^^^^^^^
foo &&= bar ^^^^^^^^^^^
foo ||= bar ^^^^^^^^^^^
Performs elliptic curve point multiplication.
The first form calculates bn1 * point + bn2 * G
, where G
is the generator of the group of point. bn2 may be omitted, and in that case, the result is just bn1 * point
.
Before version 4.0.0, and when compiled with OpenSSL
1.1.1 or older, this method allowed another form:
point.mul(bns, points [, bn2]) => point
Must be implemented in subclasses
Is this tar entry a file?
Iterates the given block for each element with an arbitrary object, obj
, and returns obj
If no block is given, returns a new Enumerator
.
to_three = Enumerator.new do |y| 3.times do |x| y << x end end to_three_with_string = to_three.with_object("foo") to_three_with_string.each do |x,string| puts "#{string}: #{x}" end # => foo: 0 # => foo: 1 # => foo: 2
DO NOT USE THIS DIRECTLY.
Hook method to return whether the obj can respond to id method or not.
When the method name parameter is given as a string, the string is converted to a symbol.
See respond_to?
, and the example of BasicObject
.
Returns true
if the stream will be closed on exec, false
otherwise:
f = File.open('t.txt') f.close_on_exec? # => true f.close_on_exec = false f.close_on_exec? # => false f.close
Sets a close-on-exec flag.
f = File.open(File::NULL) f.close_on_exec = true system("cat", "/proc/self/fd/#{f.fileno}") # cat: /proc/self/fd/3: No such file or directory f.closed? #=> false
Ruby
sets close-on-exec flags of all file descriptors by default since Ruby
2.0.0. So you don’t need to set by yourself. Also, unsetting a close-on-exec flag can cause file descriptor leak if another thread use fork() and exec() (via system() method for example). If you really needs file descriptor inheritance to child process, use spawn()‘s argument such as fd=>fd.
Makes the set compare its elements by their identity and returns self.
Returns true if the set will compare its elements by their identity. Also see Set#compare_by_identity
.