The double splat operator for Hash
The double splat operator (or keyword splat) has been around since Ruby 2.0. It’s the equivalent of the splat operator but for Hash
.
⚠️ There is a subtle difference with the splat operator. It doesn’t handle nil
. Well, not yet, because after more than 10 years, it will in Ruby 3.4.0 (see Issue 20064).
Link to Ruby documentation for double splat operator