Oldest version we support downgrading to. This is the version that originally ships with the oldest supported patch version of ruby.
Returns the form how EC::Point
data is encoded as ASN.1.
See also point_conversion_form=
.
Sets the form how EC::Point
data is encoded as ASN.1 as defined in X9.62.
format can be one of these:
:compressed
Encoded as z||x, where z is an octet indicating which solution of the equation y is. z will be 0x02 or 0x03.
:uncompressed
Encoded as z||x||y, where z is an octet 0x04.
:hybrid
Encodes as z||x||y, where z is an octet indicating which solution of the equation y is. z will be 0x06 or 0x07.
See the OpenSSL
documentation for EC_GROUP_set_point_conversion_form()
Foo ||= bar
becomes
defined?(Foo) ? Foo : Foo = bar
Calls the given block with each successive grapheme cluster from self
(see Unicode Grapheme Cluster Boundaries); returns self
:
s = "\u0061\u0308-pqr-\u0062\u0308-xyz-\u0063\u0308" # => "ä-pqr-b̈-xyz-c̈" s.each_grapheme_cluster {|gc| print gc, ' ' }
Output:
ä - p q r - b̈ - x y z - c̈
Returns an enumerator if no block is given.
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
.
Makes the set compare its elements by their identity and returns self. This method may not be supported by all subclasses of Set
.
Returns true if the set will compare its elements by their identity. Also see Set#compare_by_identity
.
for compatibility
Returns local IP addresses as an array.
The array contains Addrinfo
objects.
pp Socket.ip_address_list #=> [#<Addrinfo: 127.0.0.1>, #<Addrinfo: 192.168.0.128>, #<Addrinfo: ::1>, ...]
Sets self
to compare keys using identity (rather than mere equality); returns self
:
By default, two keys are considered to be the same key if and only if they are equal objects (per method ==
):
h = {} h['x'] = 0 h['x'] = 1 # Overwrites. h # => {"x"=>1}
When this method has been called, two keys are considered to be the same key if and only if they are the same object:
h.compare_by_identity h['x'] = 2 # Does not overwrite. h # => {"x"=>1, "x"=>2}
Related: compare_by_identity?
; see also Methods for Comparing.
Returns whether compare_by_identity
has been called:
h = {} h.compare_by_identity? # => false h.compare_by_identity h.compare_by_identity? # => true
Related: compare_by_identity
; see also Methods for Comparing.
Checks for a method provided by this the delegate object by forwarding the call through _getobj_.
Handle BasicObject
instances
If the correponding value is not set, yield a value with init_block and store the value in thread-safe manner. This method returns corresponding stored value.
(1..10).map{ Thread.new(it){|i| Ractor.store_if_absent(:s){ f(); i } #=> return stored value of key :s } }.map(&:value).uniq.size #=> 1 and f() is called only once
Attempts to enter exclusive section. Returns false
if lock fails.
For backward compatibility
Ensures that the MonitorMixin
is owned by the current thread, otherwise raises an exception.
Register a Gem::Specification
for default gem.
Two formats for the specification are supported:
MRI 2.0 style, where spec.files contains unprefixed require names. The spec’s filenames will be registered as-is.
New style, where spec.files contains files prefixed with paths from spec.require_paths. The prefixes are stripped before registering the spec’s filenames. Unprefixed files are omitted.