diff --git a/lib/dry/effects/all.rb b/lib/dry/effects/all.rb index 56f9066..6c343d9 100644 --- a/lib/dry/effects/all.rb +++ b/lib/dry/effects/all.rb @@ -21,12 +21,11 @@ module Effects end singleton_class.class_eval do - define_method(class_name) do |*args| - effect_modules.fetch_or_store([key, args]) do - ::Dry::Effects.effects[key].new(*args).freeze + define_method(class_name) do |*args, **kwargs| + effect_modules.fetch_or_store([key, args, kwargs]) do + ::Dry::Effects.effects[key].new(*args, **kwargs).freeze end end - ruby2_keywords(class_name) if respond_to?(:ruby2_keywords, true) end end diff --git a/lib/dry/effects/initializer.rb b/lib/dry/effects/initializer.rb index 876e337..a387b50 100644 --- a/lib/dry/effects/initializer.rb +++ b/lib/dry/effects/initializer.rb @@ -6,22 +6,20 @@ module Initializer # @api private module DefineWithHook # @api private - def param(*) + def param(...) super.tap do @params_arity = nil __define_with__ end end - ruby2_keywords(:param) if respond_to?(:ruby2_keywords, true) # @api private - def option(*) + def option(...) super.tap do __define_with__ unless method_defined?(:with) @has_options = true end end - ruby2_keywords(:option) if respond_to?(:ruby2_keywords, true) # @api private def params_arity