From 05934f713b699a627e05465c24464104626473d0 Mon Sep 17 00:00:00 2001 From: Pat Allan Date: Wed, 10 Mar 2021 13:15:35 +1100 Subject: [PATCH] Handle keyword arguments in a Ruby 3.0 world. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that keyword arguments are no longer implicitly translated into hashes, we need to explicitly handle them as a separate argument type. This commit may not cover all cases (either from a code or spec perspective), but hopefully it’s at least a useful start. --- lib/dry/transformer/function.rb | 20 ++++++++++++++------ lib/dry/transformer/registry.rb | 4 ++-- spec/unit/registry_spec.rb | 14 ++++++++++++++ 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/lib/dry/transformer/function.rb b/lib/dry/transformer/function.rb index 4c5a346..2496ca1 100644 --- a/lib/dry/transformer/function.rb +++ b/lib/dry/transformer/function.rb @@ -25,6 +25,13 @@ class Function # @api private attr_reader :args + # Additional keyword arguments that will be passed to the wrapped proc + # + # @return [Hash] + # + # @api private + attr_reader :kwargs + # @!attribute [r] name # # @return [