Indicates no such domain was found.
Domain Name
resource abstract class.
The RubyVM
module only exists on MRI. RubyVM
is not defined in other Ruby
implementations such as JRuby and TruffleRuby.
The RubyVM
module provides some access to MRI internals. This module is for very limited purposes, such as debugging, prototyping, and research. Normal users must not use it. This module is not portable between Ruby
implementations.
The Ruby
module that contains portable information among implementations.
The constants defined here are aliased in the toplevel with RUBY_
prefix.
Raised by Encoding
and String
methods when the string being transcoded contains a byte invalid for the either the source or target encoding.
This module is the entry-point for converting a prism syntax tree into the seattlerb/ruby_parser gem’s syntax tree.
Returns a 2-element array containing the minimum-valued and maximum-valued elements from self
; does not modify self
.
With no block given, the minimum and maximum values are determined using method #<=>
:
[1, 0, 3, 2].minmax # => [0, 3]
With a block given, the block must return a numeric; the block is called self.size - 1
times to compare elements; returns the elements having the minimum and maximum values per the block:
['0', '', '000', '00'].minmax {|a, b| a.size <=> b.size } # => ["", "000"]
Related: see Methods for Fetching.
Returns a 2-element array containing the minimum and maximum value in self
, either according to comparison method #<=>
or a given block.
With no block given, returns the minimum and maximum values, using #<=>
for comparison:
(1..4).minmax # => [1, 4] (1...4).minmax # => [1, 3] ('a'..'d').minmax # => ["a", "d"] (-4..-1).minmax # => [-4, -1]
With a block given, the block must return an integer:
Negative if a
is smaller than b
.
Zero if a
and b
are equal.
Positive if a
is larger than b
.
The block is called self.size
times to compare elements; returns a 2-element Array
containing the minimum and maximum values from self
, per the block:
(1..4).minmax {|a, b| -(a <=> b) } # => [4, 1]
Returns [nil, nil]
if:
The begin value of the range is larger than the end value:
(4..1).minmax # => [nil, nil] (4..1).minmax {|a, b| -(a <=> b) } # => [nil, nil]
The begin value of an exclusive range is equal to the end value:
(1...1).minmax # => [nil, nil] (1...1).minmax {|a, b| -(a <=> b) } # => [nil, nil]
Raises an exception if self
is a beginless or an endless range.