Sha256: 116e29776fbab562d52615573a3a8628cfa9e8c6ca8d594f2417ac38df6b77d5

Contents?: true

Size: 242 Bytes

Versions: 10

Compression:

Stored size: 242 Bytes

Contents

# See http://stackoverflow.com/questions/2393697/look-up-all-descendants-of-a-class-in-ruby
class Class
  # Returns the descendants of the class.
  def descendants
    ObjectSpace.each_object(::Class).select {|klass| klass < self }
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
powertrack-2.0.0 lib/core_ext/class.rb
powertrack-1.3.1 lib/core_ext/class.rb
powertrack-1.3.0 lib/core_ext/class.rb
powertrack-1.2.0 lib/core_ext/class.rb
powertrack-1.1.1 lib/core_ext/class.rb
powertrack-1.1.0 lib/core_ext/class.rb
powertrack-1.0.3 lib/core_ext/class.rb
powertrack-1.0.2 lib/core_ext/class.rb
powertrack-1.0.1 lib/core_ext/class.rb
powertrack-1.0.0 lib/core_ext/class.rb