Class: Class

Inherits:
Object show all
Defined in:
lib/trax/core/ext/class.rb

Instance Method Summary collapse

Instance Method Details

#superclasses_until(klass, bottom_klass = self, superclass_chain = []) ⇒ Object



2
3
4
5
6
7
8
9
# File 'lib/trax/core/ext/class.rb', line 2

def superclasses_until(klass, bottom_klass=self, superclass_chain = [])
  if bottom_klass.superclass != klass
    superclass_chain.unshift(bottom_klass.superclass)
    return superclasses_until(klass, bottom_klass.superclass, superclass_chain)
  else
    return superclass_chain
  end
end