Arguments forwarding in Ruby

October, 2020

Ruby 2.7 introduced a shorthand syntax (...) for forwarding arguments to methods.

# using args, kwargs, and block arguments
def perform(*args, **kwargs, &block)
  block.call(args, kws)
end

# using the new syntax
def call(...)
  perform(...)
end