Ruby

What's new in Interactive Ruby Shell (IRB) with Ruby 2.7

List of new and experimental features in the Interactive Ruby Shell(IRB) which are introduced with Ruby 2.7.

Ruby 2.7 adds Module#const_source_location

Ruby 2.7 has added Module#const_source_location to get the source location of a constant

Ruby 2.7 adds warning for Proc.new and proc without block and error for lambda without block

In Ruby 2.7 Proc.new and proc with no block in a method called with a block is warned now and lambda with no block in a method called with a block will give errors.

Ruby 2.7 adds FrozenError#receiver

Ruby 2.7 has added `FrozenError#receiver` to return the frozen object on which modification was attempted

Ruby 2.7 adds Time#ceil and Time#floor methods

Ruby 2.7 adds Time#ceil and Time#floor methods to round up and down the decimal part of Time (nanosecond) to the specified digit

Ruby 2.7 adds beginless range

A beginless range is experimentally introduced in ruby 2.7.

Ruby 2.7 adds Enumerable#filter_map

Ruby 2.7 has added Enumerable#filter_map as a shorthand for filter + map in a single call

Ruby 2.7 adds Enumerable#tally

Ruby 2.7 has added Enumerable#tally. It helps to tally occurrences of elements in an Enumerable.

Ruby 2.7 adds shorthand operator for Object#method

Ruby 2.7 adds experimental shorthand operator for Object#method. Allows method object access using :, example File.:basename