class RDoc::Parser::Ruby

def get_method_container container, name_t # :nodoc:

:nodoc:
def get_method_container container, name_t # :nodoc:
  prev_container = container
  container = container.find_module_named(name_t[:text])
  unless container then
    constant = prev_container.constants.find do |const|
      const.name == name_t[:text]
    end
    if constant then
      parse_method_dummy prev_container
      return
    end
  end
  unless container then
    # TODO seems broken, should starting at Object in @store
    obj = name_t[:text].split("::").inject(Object) do |state, item|
      state.const_get(item)
    end rescue nil
    type = obj.class == Class ? RDoc::NormalClass : RDoc::NormalModule
    unless [Class, Module].include?(obj.class) then
      warn("Couldn't find #{name_t[:text]}. Assuming it's a module")
    end
    if type == RDoc::NormalClass then
      sclass = obj.superclass ? obj.superclass.name : nil
      container = prev_container.add_class type, name_t[:text], sclass
    else
      container = prev_container.add_module type, name_t[:text]
    end
    record_location container
  end
  container
end