2
require 'rdoc/markup/simple_markup/fragments'
4
# Descriptions are created by RDoc (in ri_generator) and
5
# written out in serialized form into the documentation
6
# tree. ri then reads these to generate the documentation
27
# Alias = Struct.new(:old_name, :new_name)
29
class AliasName < NamedThing
32
class Attribute < NamedThing
33
attr_reader :rw, :comment
34
def initialize(name, rw, comment)
41
class Constant < NamedThing
42
attr_reader :value, :comment
43
def initialize(name, value, comment)
50
class IncludedModule < NamedThing
54
class MethodSummary < NamedThing
55
def initialize(name="")
64
attr_accessor :full_name
65
attr_accessor :comment
71
def Description.deserialize(from)
80
class ModuleDescription < Description
82
attr_accessor :class_methods
83
attr_accessor :instance_methods
84
attr_accessor :attributes
85
attr_accessor :constants
86
attr_accessor :includes
88
# merge in another class desscription into this one
90
merge(@class_methods, old.class_methods)
91
merge(@instance_methods, old.instance_methods)
92
merge(@attributes, old.attributes)
93
merge(@constants, old.constants)
94
merge(@includes, old.includes)
95
if @comment.nil? || @comment.empty?
96
@comment = old.comment
98
unless old.comment.nil? or old.comment.empty? then
99
@comment << SM::Flow::RULE.new
100
@comment.concat old.comment
109
# the 'ClassDescription' subclass overrides this
110
# to format up the name of a parent
111
def superclass_string
117
def merge(into, from)
119
into.each {|i| names[i.name] = i }
120
from.each {|i| names[i.name] = i }
121
into.replace(names.keys.sort.map {|n| names[n]})
125
class ClassDescription < ModuleDescription
126
attr_accessor :superclass
132
def superclass_string
133
if @superclass && @superclass != "Object"
142
class MethodDescription < Description
144
attr_accessor :is_class_method
145
attr_accessor :visibility
146
attr_accessor :block_params
147
attr_accessor :is_singleton
148
attr_accessor :aliases
149
attr_accessor :is_alias_for
150
attr_accessor :params