summaryrefslogtreecommitdiff
path: root/lib/rdoc/code_object.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rdoc/code_object.rb')
-rw-r--r--lib/rdoc/code_object.rb43
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/rdoc/code_object.rb b/lib/rdoc/code_object.rb
index 606fd8ff49..54826fffbd 100644
--- a/lib/rdoc/code_object.rb
+++ b/lib/rdoc/code_object.rb
@@ -114,6 +114,7 @@ class RDoc::CodeObject
@done_documenting = false
@force_documentation = false
@received_nodoc = false
+ @ignored = false
end
##
@@ -140,6 +141,13 @@ class RDoc::CodeObject
end
##
+ # Should this CodeObject be shown in documentation?
+
+ def display?
+ @document_self and not @ignored
+ end
+
+ ##
# Enables or disables documentation of this CodeObject's children unless it
# has been turned off by :enddoc:
@@ -195,6 +203,11 @@ class RDoc::CodeObject
self
end
+ ##
+ # File name where this CodeObject was found.
+ #
+ # See also RDoc::Context#in_files
+
def file_name
return unless @file
@@ -221,6 +234,34 @@ class RDoc::CodeObject
end
##
+ # Use this to ignore a CodeObject and all its children until found again
+ # (#record_location is called). An ignored item will not be shown in
+ # documentation.
+ #
+ # See github issue #55
+ #
+ # The ignored status is temporary in order to allow implementation details
+ # to be hidden. At the end of processing a file RDoc allows all classes
+ # and modules to add new documentation to previously created classes.
+ #
+ # If a class was ignored (via stopdoc) then reopened later with additional
+ # documentation it should be shown. If a class was ignored and never
+ # reopened it should not be shown. The ignore flag allows this to occur.
+
+ def ignore
+ @ignored = true
+
+ stop_doc
+ end
+
+ ##
+ # Has this class been ignored?
+
+ def ignored?
+ @ignored
+ end
+
+ ##
# File name of our parent
def parent_file_name
@@ -238,6 +279,7 @@ class RDoc::CodeObject
# Records the RDoc::TopLevel (file) where this code object was defined
def record_location top_level
+ @ignored = false
@file = top_level
end
@@ -250,6 +292,7 @@ class RDoc::CodeObject
@document_self = true
@document_children = true
+ @ignored = false
end
##