mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 21:14:23 +02:00
parent
478e0fc710
commit
7ae4b858b3
4 changed files with 41 additions and 8 deletions
|
@ -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}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue