Method: RDoc::Context#add_class_or_module

Defined in:
lib/rdoc/code_object/context.rb

#add_class_or_module(mod, self_hash, all_hash) ⇒ Object

Adds the class or module mod to the modules or classes Hash self_hash, and to all_hash (either TopLevel::modules_hash or TopLevel::classes_hash), unless #done_documenting is true. Sets the #parent of mod to self, and its #section to #current_section. Returns mod.



404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
# File 'lib/rdoc/code_object/context.rb', line 404

def add_class_or_module mod, self_hash, all_hash
  mod.section = current_section # TODO declaring context? something is
                                # wrong here...
  mod.parent = self
  mod.full_name = nil
  mod.store = @store

  unless @done_documenting then
    self_hash[mod.name] = mod
    # this must be done AFTER adding mod to its parent, so that the full
    # name is correct:
    all_hash[mod.full_name] = mod
    if @store.unmatched_constant_alias[mod.full_name] then
      to, file = @store.unmatched_constant_alias[mod.full_name]
      add_module_alias mod, mod.name, to, file
    end
  end

  mod
end