Skip to content

Commit

Permalink
Refactor fully_qualified_nesting_namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
unasuke committed Jul 6, 2023
1 parent 11d3c95 commit 0e05c99
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rdoc/class_module.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 0e05c99

Please sign in to comment.