@@ -114,6 +114,7 @@ def initialize
114114 @done_documenting = false
115115 @force_documentation = false
116116 @received_nodoc = false
117+ @ignored = false
117118 end
118119
119120 ##
@@ -139,6 +140,13 @@ def comment=(comment)
139140 end
140141 end
141142
143+ ##
144+ # Should this CodeObject be shown in documentation?
145+
146+ def display?
147+ @document_self and not @ignore
148+ end
149+
142150 ##
143151 # Enables or disables documentation of this CodeObject's children unless it
144152 # has been turned off by :enddoc:
@@ -195,6 +203,11 @@ def each_parent
195203 self
196204 end
197205
206+ ##
207+ # File name where this CodeObject was found.
208+ #
209+ # See also RDoc::Context#in_files
210+
198211 def file_name
199212 return unless @file
200213
@@ -220,6 +233,34 @@ def full_name= full_name
220233 @full_name = full_name
221234 end
222235
236+ ##
237+ # Use this to ignore a CodeObject and all its children until found again
238+ # (#record_location is called). An ignored item will not be shown in
239+ # documentation.
240+ #
241+ # See github issue #55
242+ #--
243+ # The ignored status is temporary in order to allow implementation details
244+ # to be hidden. At the end of processing a file RDoc allows all classes
245+ # and modules to add documentation.
246+ #
247+ # If a class was ignored (via stopdoc) then reopened later with additional
248+ # documentation it should be shown. If a class was ignored and never
249+ # reopened it should not be shown. The ignore flag allows this to occur.
250+
251+ def ignore
252+ @ignored = true
253+
254+ stop_doc
255+ end
256+
257+ ##
258+ # Has this class been ignored?
259+
260+ def ignored?
261+ @ignored
262+ end
263+
223264 ##
224265 # File name of our parent
225266
@@ -238,6 +279,7 @@ def parent_name
238279 # Records the RDoc::TopLevel (file) where this code object was defined
239280
240281 def record_location top_level
282+ @ignored = false
241283 @file = top_level
242284 end
243285
@@ -250,6 +292,7 @@ def start_doc
250292
251293 @document_self = true
252294 @document_children = true
295+ @ignored = false
253296 end
254297
255298 ##
0 commit comments