File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -255,9 +255,7 @@ def param_list
255255 end
256256
257257 if @block_params then
258- # If this method has explicit block parameters, remove any explicit
259- # &block
260- params = params . sub ( /,?\s *&\w +/ , '' )
258+ params = remove_explicit_block_param ( params )
261259 else
262260 params = params . sub ( /\& (\w +)/ , '\1' )
263261 end
@@ -285,9 +283,7 @@ def param_seq
285283 end
286284
287285 if @block_params then
288- # If this method has explicit block parameters, remove any explicit
289- # &block
290- params = params . sub ( /,?\s *&\w +/ , '' )
286+ params = remove_explicit_block_param ( params )
291287
292288 block = @block_params . tr_s ( "\n " , " " )
293289 if block [ 0 ] == ?(
@@ -344,6 +340,13 @@ def _call_seq
344340
345341 private
346342
343+ ##
344+ # Removes the explicit &block parameter if the method has explicit block parameters
345+
346+ def remove_explicit_block_param ( params )
347+ params . sub ( /,?\s *&\w +/ , '' )
348+ end
349+
347350 ##
348351 # call_seq with alias examples information removed, if this
349352 # method is an alias method.
You can’t perform that action at this time.
0 commit comments