File tree Expand file tree Collapse file tree 1 file changed +1
-25
lines changed
lib/dry/initializer/builders Expand file tree Collapse file tree 1 file changed +1
-25
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ def coercion_line
71
71
72
72
arity = @type . is_a? ( Proc ) ? @type . arity : @type . method ( :call ) . arity
73
73
type_call_params = \
74
- ( arity . equal? ( 1 ) || arity . negative? ) ? @val : "#{ @val } , self"
74
+ arity . equal? ( 1 ) || arity . negative? ? @val : "#{ @val } , self"
75
75
76
76
<<-COERCE
77
77
begin
@@ -84,30 +84,6 @@ def coercion_line
84
84
COERCE
85
85
end
86
86
87
- def coercion_lineSAVE
88
- return unless @type
89
-
90
- arity = @type . is_a? ( Proc ) ? @type . arity : @type . method ( :call ) . arity
91
-
92
- if arity . equal? ( 1 ) || arity . negative?
93
- <<-METH
94
- begin
95
- #{ @val } = #{ @item } .type.call(#{ @val } ) unless #{ @null } == #{ @val }
96
- rescue Dry::Types::ConstraintError => e
97
- raise Dry::Initializer::CoercionError.new(e, '#{ @source } ')
98
- end
99
- METH
100
- else
101
- <<-METH
102
- begin
103
- #{ @val } = #{ @item } .type.call(#{ @val } , self) unless #{ @null } == #{ @val }
104
- rescue Dry::Types::ConstraintError => e
105
- raise Dry::Initializer::CoercionError.new(e, '#{ @source } ')
106
- end
107
- METH
108
- end
109
- end
110
-
111
87
def assignment_line
112
88
"#{ @ivar } = #{ @val } " \
113
89
" unless #{ @null } == #{ @val } && instance_variable_defined?(:#{ @ivar } )"
You can’t perform that action at this time.
0 commit comments