2 require 'rdoc/markup/fragments'
6 # Descriptions are created by RDoc (in ri_generator) and written out in
7 # serialized form into the documentation tree. ri then reads these to generate
10 class RDoc::RI::NamedThing
29 class RDoc::RI::AliasName < RDoc::RI::NamedThing; end
31 class RDoc::RI::Attribute < RDoc::RI::NamedThing
32 attr_reader :rw, :comment
34 def initialize(name, rw, comment)
41 class RDoc::RI::Constant < RDoc::RI::NamedThing
42 attr_reader :value, :comment
44 def initialize(name, value, comment)
51 class RDoc::RI::IncludedModule < RDoc::RI::NamedThing; end
53 class RDoc::RI::MethodSummary < RDoc::RI::NamedThing
54 def initialize(name="")
59 class RDoc::RI::Description
61 attr_accessor :full_name
62 attr_accessor :comment
68 def self.deserialize(from)
77 class RDoc::RI::ModuleDescription < RDoc::RI::Description
79 attr_accessor :class_methods
80 attr_accessor :instance_methods
81 attr_accessor :attributes
82 attr_accessor :constants
83 attr_accessor :includes
85 # merge in another class description into this one
87 merge(@class_methods, old.class_methods)
88 merge(@instance_methods, old.instance_methods)
89 merge(@attributes, old.attributes)
90 merge(@constants, old.constants)
91 merge(@includes, old.includes)
92 if @comment.nil? || @comment.empty?
93 @comment = old.comment
95 unless old.comment.nil? or old.comment.empty? then
96 if @comment.nil? or @comment.empty? then
97 @comment = old.comment
99 @comment << RDoc::Markup::Flow::RULE.new
100 @comment.concat old.comment
110 # the 'ClassDescription' subclass overrides this
111 # to format up the name of a parent
112 def superclass_string
118 def merge(into, from)
120 into.each {|i| names[i.name] = i }
121 from.each {|i| names[i.name] = i }
122 into.replace(names.keys.sort.map {|n| names[n]})
126 class RDoc::RI::ClassDescription < RDoc::RI::ModuleDescription
127 attr_accessor :superclass
133 def superclass_string
134 if @superclass && @superclass != "Object"
142 class RDoc::RI::MethodDescription < RDoc::RI::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