Class RDoc::Generator::Context
In: lib/rdoc/generator.rb
Parent: Object
CodeObject Include Context Alias Attr AnyMethod Constant Require ClassModule NormalModule SingleClass AnonClass NormalClass TopLevel RubyParser RubyToken RuntimeError Error Error AttributeFormatter AnsiFormatter OverstrikeFormatter HtmlFormatter DefaultDisplay NamedThing IncludedModule Attribute Constant MethodSummary AliasName ClassEntry TopLevelEntry Description MethodDescription ModuleDescription ClassDescription Formatter SimpleFormatter HTML HTMLInOne XML CHM Context Method Class File Element Edge Node Subgraph Digraph SimpleElement Port Options Diagram Fortran95parser RDoc SimpleParser Token Markup TemplatePage Stats C_Parser NameDescriptor Cache Reader Writer Driver MethodEntry RI AllReferences Display Paths RI MarkUp Generator TokenStream ParserFactory DOT RDoc dot/f_4.png

A Context is built by the parser to represent a container: contexts hold classes, modules, methods, require lists and include lists. ClassModule and TopLevel are the context objects we process here

Methods

Included Modules

MarkUp

Public Class methods

Generate:

Public Instance methods

create table of contents if we contain sections

Returns a reference to outselves to be used as an href= the form depends on whether we‘re all in one file or in multiple files

Build a list of aliases for which we couldn‘t find a corresponding method

Build the structured list of classes and modules contained in this context.

Build a list of constants

Build an array of arrays of method details. The outer array has up to six entries, public, private, and protected for both class methods, the other for instance methods. The inner arrays contain a hash for each method

Build a summary list of all the methods in this context

Create a list of Method objects for each method in the corresponding context object. If the @options.show_all variable is set (corresponding to the —all option, we include all methods, otherwise just the public ones.

Find a symbol in ourselves or our parent

convenience method to build a hyperlink

Build a list from an array of Context items. Look up each in the AllReferences hash: if we find a corresponding entry, we generate a hyperlink to it, otherwise just output the name. However, some names potentially need massaging. For example, you may require a Ruby file without the .rb extension, but the file names we know about may have it. To deal with this, we pass in a block which performs the massaging, returning an array of alternative names to match

[Validate]