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 Nov 25, 2024
1 parent 7a6015a commit f54449d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rdoc/code_object/class_module.rb
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,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 f54449d

Please sign in to comment.