method

handle_class_module

Importance_0
v1_9_1_378 - Show latest stable - 0 notes - Class: C
handle_class_module(var_name, class_mod, class_name, parent, in_module) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/rdoc/parser/c.rb, line 462
  def handle_class_module(var_name, class_mod, class_name, parent, in_module)
    parent_name = @known_classes[parent] || parent

    if in_module
      enclosure = @classes[in_module] || @@enclosure_classes[in_module]
      unless enclosure
        if enclosure = @known_classes[in_module]
          handle_class_module(in_module, (/^rb_m/ =~ in_module ? "module" : "class"),
                              enclosure, nil, nil)
          enclosure = @classes[in_module]
        end
      end
      unless enclosure
        warn("Enclosing class/module '#{in_module}' for " +
              "#{class_mod} #{class_name} not known")
        return
      end
    else
      enclosure = @top_level
    end

    if class_mod == "class" then
      full_name = enclosure.full_name.to_s + "::#{class_name}"
      if @content =~ %{Document-class:\s+#{full_name}\s*<\s+([:,\w]+)} then
        parent_name = $1
      end
      cm = enclosure.add_class RDoc::NormalClass, class_name, parent_name
      @stats.add_class cm
    else
      cm = enclosure.add_module RDoc::NormalModule, class_name
      @stats.add_module cm
    end

    cm.record_location(enclosure.toplevel)

    find_class_comment(cm.full_name, cm)
    @classes[var_name] = cm
    @@enclosure_classes[var_name] = cm
    @known_classes[var_name] = cm.full_name
  end
Register or log in to add new notes.