Object
Base class for the RDoc code tree.
We contain the common stuff for contexts (which are containers) and other elements (methods, attributes and so on)
Here’s the tree of the CodeObject subclasses:
Creates a new CodeObject that will document itself and its children
# File lib/rdoc/code_object.rb, line 82
82: def initialize
83: @metadata = {}
84: @comment = ''
85:
86: @document_children = true
87: @document_self = true
88: @done_documenting = false
89: @force_documentation = false
90:
91: @parent = nil
92: end
Replaces our comment with comment, unless it is empty.
# File lib/rdoc/code_object.rb, line 97
97: def comment=(comment)
98: @comment = case comment
99: when NilClass then ''
100: when RDoc::Markup::Document then comment
101: else
102: if comment and not comment.empty? then
103: normalize_comment comment
104: else
105: @comment
106: end
107: end
108: end
Enables or disables documentation of this CodeObject’s children. Calls remove_classes_and_modules when disabling.
# File lib/rdoc/code_object.rb, line 114
114: def document_children=(document_children)
115: @document_children = document_children
116: remove_classes_and_modules unless document_children
117: end
Enables or disables documentation of this CodeObject. Calls remove_methods_etc when disabling.
# File lib/rdoc/code_object.rb, line 123
123: def document_self=(document_self)
124: @document_self = document_self
125: remove_methods_etc unless document_self
126: end
Does this class have a comment with content or is document_self false.
# File lib/rdoc/code_object.rb, line 131
131: def documented?
132: !(@document_self and @comment.empty?)
133: end
File name of our parent
# File lib/rdoc/code_object.rb, line 138
138: def parent_file_name
139: @parent ? @parent.base_name : '(unknown)'
140: end
Name of our parent
# File lib/rdoc/code_object.rb, line 145
145: def parent_name
146: @parent ? @parent.full_name : '(unknown)'
147: end
Callback called upon disabling documentation of children. See document_children=
# File lib/rdoc/code_object.rb, line 153
153: def remove_classes_and_modules
154: end
Callback called upon disabling documentation of ourself. See document_self=
# File lib/rdoc/code_object.rb, line 160
160: def remove_methods_etc
161: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.
Our comment