Skip to content

Commit

Permalink
Remove ruby2_keywords
Browse files Browse the repository at this point in the history
It's irrelevant when 3.0 is required
  • Loading branch information
flash-gordon committed May 24, 2024
1 parent 837d807 commit d8025e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
7 changes: 3 additions & 4 deletions lib/dry/effects/all.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 2 additions & 4 deletions lib/dry/effects/initializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d8025e9

Please sign in to comment.