Feb 16, 2022
Ruby 3.1 adds error highlighting gem
With changes in Ruby 3.1, we will be able to know which object is nil when an error gets raised.
Jan 11, 2022
Ruby 3.1 adds Class#subclasses
Ruby 3.1's new method Class#subclasses returns all classes directly from the receiver without adding singleton classes.
Dec 22, 2021
Ruby 3.1 adds Class#descendants
With Ruby 3.1, we can use `Class#descendants` to yield the classes that have been directly or indirectly derived from a specific class.
Nov 24, 2021
Ruby 3.1 adds MatchData#match and MatchData#match_length
Ruby 3.1 MatchData#match returns the substring corresponding to the argument, while MatchData#match_length returns the length of the captured substring.
Sep 28, 2021
Ruby 3.1 allows value omission in hash literals
Ruby 3.1 adds the ability to use hash literals without having a value.
Aug 3, 2021
Ruby 3.1 adds try_convert method to Integer class for implicit conversions
try_convert for Integer will convert the object into an instance of the class via the implicit conversion method to_int and returns nil if no implicit conversion method is defined.
Jul 7, 2021
Ruby 3.1 introduces pattern matching pin operator against expression
Ruby 3.1 adds support for the expression and range when using the pattern matching pin operator.
Jun 15, 2021
Ruby 3.1 adds Enumerable#compact and Enumerator::Lazy#compact
Ruby 3.1 adds Enumerable#compact and Enumerator::Lazy#compact to return a copy of `self` with all `nil` elements removed.