@@ -298,8 +298,7 @@ def handle_meta_method_comment(comment, node)
298298 end
299299 elsif line_no || node
300300 method_name ||= call_node_name_arguments ( node ) . first if is_call_node
301- meth = RDoc ::AnyMethod . new ( @container , method_name )
302- meth . singleton = @singleton || singleton_method
301+ meth = RDoc ::AnyMethod . new ( @container , method_name , singleton : @singleton || singleton_method )
303302 handle_consecutive_comment_directive ( meth , comment )
304303 comment . normalize
305304 meth . call_seq = comment . extract_call_seq
@@ -315,7 +314,6 @@ def handle_meta_method_comment(comment, node)
315314 meth ,
316315 line_no : line_no ,
317316 visibility : visibility ,
318- singleton : @singleton || singleton_method ,
319317 params : '()' ,
320318 calls_super : false ,
321319 block_params : nil ,
@@ -511,7 +509,7 @@ def add_method(name, receiver_name:, receiver_fallback_type:, visibility:, singl
511509 return if @in_proc_block
512510
513511 receiver = receiver_name ? find_or_create_module_path ( receiver_name , receiver_fallback_type ) : @container
514- meth = RDoc ::AnyMethod . new ( nil , name )
512+ meth = RDoc ::AnyMethod . new ( nil , name , singleton : singleton )
515513 if ( comment = consecutive_comment ( start_line ) )
516514 handle_consecutive_comment_directive ( @container , comment )
517515 handle_consecutive_comment_directive ( meth , comment )
@@ -530,7 +528,6 @@ def add_method(name, receiver_name:, receiver_fallback_type:, visibility:, singl
530528 meth ,
531529 line_no : start_line ,
532530 visibility : visibility ,
533- singleton : singleton ,
534531 params : params ,
535532 calls_super : calls_super ,
536533 block_params : block_params ,
@@ -550,12 +547,11 @@ def add_method(name, receiver_name:, receiver_fallback_type:, visibility:, singl
550547 end
551548 end
552549
553- private def internal_add_method ( container , meth , line_no :, visibility :, singleton : , params :, calls_super :, block_params :, tokens :) # :nodoc:
550+ private def internal_add_method ( container , meth , line_no :, visibility :, params :, calls_super :, block_params :, tokens :) # :nodoc:
554551 meth . name ||= meth . call_seq [ /\A [^()\s ]+/ ] if meth . call_seq
555552 meth . name ||= 'unknown'
556553 meth . store = @store
557554 meth . line = line_no
558- meth . singleton = singleton
559555 container . add_method ( meth ) # should add after setting singleton and before setting visibility
560556 meth . visibility = visibility
561557 meth . params ||= params
0 commit comments