Parent

Included Modules

RDoc::CodeObject

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:

Attributes

comment[R]

Our comment

document_children[R]

Do we document our children?

document_self[R]

Do we document ourselves?

done_documenting[RW]

Are we done documenting (ie, did we come across a :enddoc:)?

force_documentation[RW]

Force documentation of this CodeObject

metadata[R]

Hash of arbitrary metadata for this CodeObject

parent[RW]

Our parent CodeObject

section[RW]

Which section are we in

viewer[RW]

We are the model of the code, but we know that at some point we will be worked on by viewers. By implementing the Viewable protocol, viewers can associated themselves with these objects.

Public Class Methods

new() click to toggle source

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

Public Instance Methods

comment=(comment) click to toggle source

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
document_children=(document_children) click to toggle source

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
document_self=(document_self) click to toggle source

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
documented?() click to toggle source

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
parent_file_name() click to toggle source

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
parent_name() click to toggle source

Name of our parent

     # File lib/rdoc/code_object.rb, line 145
145:   def parent_name
146:     @parent ? @parent.full_name : '(unknown)'
147:   end
remove_classes_and_modules() click to toggle source

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
remove_methods_etc() click to toggle source

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
start_doc() click to toggle source

Enable capture of documentation

     # File lib/rdoc/code_object.rb, line 166
166:   def start_doc
167:     @document_self = true
168:     @document_children = true
169:   end
stop_doc() click to toggle source

Disable capture of documentation

     # File lib/rdoc/code_object.rb, line 174
174:   def stop_doc
175:     @document_self = false
176:     @document_children = false
177:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.