From 58bb3d98109b18f8bec260f99e7cc094e0bcb7fa Mon Sep 17 00:00:00 2001 From: Petrik Date: Fri, 30 Jan 2026 19:29:25 +0100 Subject: [PATCH] Add example of :method: directive getting ignored. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also make the comment about hidden methods slightly clearer — these methods don't appear in the code, but they appear in the generated documentation. --- lib/rdoc/parser/ruby.rb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/rdoc/parser/ruby.rb b/lib/rdoc/parser/ruby.rb index c9b662c90a..5377bb2855 100644 --- a/lib/rdoc/parser/ruby.rb +++ b/lib/rdoc/parser/ruby.rb @@ -131,8 +131,8 @@ # # == Hidden methods and attributes # -# You can provide documentation for methods that don't appear using -# the :method:, :singleton-method: and :attr: directives: +# You can provide documentation for methods that don't appear in the code +# using the :method:, :singleton-method: and :attr: directives: # # ## # # :attr_writer: ghost_writer @@ -148,8 +148,13 @@ # def regular_method() end # # Note that by default, the :method: directive will be ignored if there is a -# standard rdocable item following it. - +# standard rdocable item following it: +# +# ## +# # :method: ghost_method +# # ghost_method will be ignored. +# +# def standard_rdocable_method() end class RDoc::Parser::Ruby < RDoc::Parser parse_files_matching(/\.rbw?$/)