[ruby/rdoc] Display class ancestors in the sidebar #1183

50dda13426
This commit is contained in:
Alexis Bernard 2024-11-04 18:34:23 +01:00 committed by git
parent 478e0fc710
commit 7ae4b858b3
4 changed files with 41 additions and 8 deletions

View file

@ -711,6 +711,20 @@ class RDoc::ClassModule < RDoc::Context
@superclass = superclass
end
##
# Get all super classes of this class in an array. The last element might be
# a string if the name is unknown.
def super_classes
result = []
parent = self
while parent = parent.superclass
result << parent
return result if parent.is_a?(String)
end
result
end
def to_s # :nodoc:
if is_alias_for then
"#{self.class.name} #{self.full_name} -> #{is_alias_for}"