Skip to content

Commit 0e05c99

Browse files
committed
Refactor fully_qualified_nesting_namespaces
1 parent 11d3c95 commit 0e05c99

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/rdoc/class_module.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,8 @@ def nesting_namespaces
308308

309309
def fully_qualified_nesting_namespaces
310310
return nesting_namespaces if nesting_namespaces.length < 2
311-
@fqns ||= nesting_namespaces.map.with_index do |_, i|
312-
nesting_namespaces[0..i].join("::")
311+
@fqns ||= nesting_namespaces.inject([]) do |list, n|
312+
list << (list.empty? ? n : "#{list.last}::#{n}")
313313
end
314314
end
315315

0 commit comments

Comments
 (0)