This is really cool feature. If you want to just pass all the arguments of the current method to a new method, Ruby 2.7 makes it dead easy with the help (…).
Those are the kind of features I really fear. They look good and useful and simple, but they make code so much less grep-able.
It shouldn’t be a thing for 99% of delegations since the Forwardable module handles most of that work. The trick would be how many Rubyists know about this rather than jumping on the ellipsis operator.
filter_map is a method I’ve wanted for quite a while. Ruby is a language that knows what it is, and keeps moving in that direction, rather than trying to be all things to all people, and I appreciate that about it.
Those are the kind of features I really fear. They look good and useful and simple, but they make code so much less grep-able.
It shouldn’t be a thing for 99% of delegations since the Forwardable module handles most of that work. The trick would be how many Rubyists know about this rather than jumping on the ellipsis operator.
Forwardable is almost never used in practice because it has an annoying API.
filter_map
is a method I’ve wanted for quite a while. Ruby is a language that knows what it is, and keeps moving in that direction, rather than trying to be all things to all people, and I appreciate that about it.It’s unfortunate destructuring is a bit verbose, for someone spoiled by JS. Nevertheless I’m looking forward to try out these shiny new toys!