diff options
Diffstat (limited to 'lib/rdoc/code_object')
-rw-r--r-- | lib/rdoc/code_object/class_module.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/rdoc/code_object/class_module.rb b/lib/rdoc/code_object/class_module.rb index a99acb8956..9230c46983 100644 --- a/lib/rdoc/code_object/class_module.rb +++ b/lib/rdoc/code_object/class_module.rb @@ -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}" |