diff --git a/lib/rdoc/class_module.rb b/lib/rdoc/class_module.rb index 85710fadbc..7a0bec72d8 100644 --- a/lib/rdoc/class_module.rb +++ b/lib/rdoc/class_module.rb @@ -308,8 +308,8 @@ def nesting_namespaces def fully_qualified_nesting_namespaces return nesting_namespaces if nesting_namespaces.length < 2 - @fqns ||= nesting_namespaces.map.with_index do |_, i| - nesting_namespaces[0..i].join("::") + @fqns ||= nesting_namespaces.inject([]) do |list, n| + list << (list.empty? ? n : "#{list.last}::#{n}") end end