lib/dry/initializer/attribute.rb in dry-initializer-1.1.1 vs lib/dry/initializer/attribute.rb in dry-initializer-1.1.2
- old
+ new
@@ -57,9 +57,10 @@
def getter
return unless reader
command = %w(private protected).include?(reader.to_s) ? reader : :public
<<-RUBY.gsub(/^ *\|/, "")
+ |undef_method :#{target} if method_defined?(:#{target}) || protected_method_defined?(:#{target}) || private_method_defined?(:#{target})
|def #{target}
| @#{target} unless @#{target} == Dry::Initializer::UNDEFINED
|end
|#{command} :#{target}
RUBY