dry-transformer icon indicating copy to clipboard operation
dry-transformer copied to clipboard

Support keyword arguments for functions.

Open pat opened this issue 3 years ago • 4 comments

Another Ruby 3 related patch: now that keyword arguments are no longer implicitly translated into hashes, we need to explicitly handle them as a separate argument type.

And I must be clear: I don't have a deep understanding of this gem, so I feel like the specs and code are quite possibly incomplete. Hopefully they're at least useful as a starting point. 😅

pat avatar Mar 10 '21 02:03 pat

… and now that I removed the :focus that avoided the full suite from running, I can see that the build is not happy at all with pre-3.0 Rubies. And I'm feeling well and truly out of my depth.

I might set this aside for now, rather than muddling my way through the failing tests. Hopefully what's here is useful, but for now I think I'm going to change my functions to avoid keyword arguments.

pat avatar Mar 10 '21 03:03 pat

Thanks. It's best to hold off with this. I think it would be good to revisit the implementation of this gem in general, given how many things changed in Ruby since transproc was born (which is now dry-transformer).

solnic avatar Mar 10 '21 08:03 solnic