Skip to content

Commit

Permalink
Remove existing #with methods on Initializer inclusion (closes #90)
Browse files Browse the repository at this point in the history
This makes it work with the new "smart" feature from AS
  • Loading branch information
flash-gordon committed Mar 14, 2024
1 parent af3100d commit 61c7a5b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/dry/effects/initializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,15 @@ def with(**new_options) # def with(**new_opti

# @api private
def self.extended(base)
base.extend(::Dry::Initializer)
base.extend(DefineWithHook)
base.include(InstanceMethods)
base.module_eval do
if method_defined?(:with)
undef_method(:with)
end

extend(::Dry::Initializer)
extend(DefineWithHook)
include(InstanceMethods)
end
end

# @api private
Expand Down

0 comments on commit 61c7a5b

Please sign in to comment.