Class: Class
Instance Method Summary collapse
-
#has_ancestor?(klass) ⇒ Boolean
:nodoc:.
Instance Method Details
#has_ancestor?(klass) ⇒ Boolean
:nodoc:
8 9 10 11 12 13 14 15 16 |
# File 'lib/utilrb/module/ancestor_p.rb', line 8 def has_ancestor?(klass) # :nodoc: # We first test # self <= class # as self.superclass goes to the next *CLASS* in the chain, i.e. skips # included modules # # Then, the superclass test is used in case +self+ is a singleton self <= klass || (superclass <= klass) end |