File tree Expand file tree Collapse file tree 4 files changed +5
-5
lines changed Expand file tree Collapse file tree 4 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ def safe_default
51
51
52
52
def default_part
53
53
if default
54
- " { instance_eval (&__defaults__[:'option_#{ source } ']) }"
54
+ " { instance_exec (&__defaults__[:'option_#{ source } ']) }"
55
55
elsif !optional
56
56
" { raise ArgumentError, \" option :'#{ source } ' is required\" }"
57
57
end
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ def maybe_default
45
45
def default_part
46
46
return unless default
47
47
" == Dry::Initializer::UNDEFINED ?" \
48
- " instance_eval (&__defaults__[:param_#{ target } ]) :" \
48
+ " instance_exec (&__defaults__[:param_#{ target } ]) :" \
49
49
" #{ target } "
50
50
end
51
51
end
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ class Test::Foo
4
4
extend Dry ::Initializer ::Mixin
5
5
6
6
param :foo , default : proc { nil }
7
- param :bar , default : proc { nil }
7
+ param :bar , default : -> { nil }
8
8
end
9
9
end
10
10
Original file line number Diff line number Diff line change @@ -5,9 +5,9 @@ class Test::Foo
5
5
6
6
param :foo , default : proc { :FOO }
7
7
param :bar , default : proc { :BAR }
8
- option :baz , default : proc { :BAZ }
8
+ option :baz , default : -> { :BAZ }
9
9
option :qux , default : proc { foo }
10
- option :mox , default : proc { default_mox }
10
+ option :mox , default : -> { default_mox }
11
11
12
12
private
13
13
You can’t perform that action at this time.
0 commit comments