Sha256: 624fadf282b3fa01ef1395264f9603fb0b9f49057324c0b87b01251d5163ace3

Contents?: true

Size: 230 Bytes

Versions: 127

Compression:

Stored size: 230 Bytes

Contents

class Class
  def subclasses
    result = []
    ObjectSpace.each_object(Class) do |k|
      next unless k < self
      next if k.respond_to?(:singleton_class?) && k.singleton_class?
      result << k
    end
    result
  end
end

Version data entries

127 entries across 127 versions & 1 rubygems

Version Path
specinfra-2.70.2 lib/specinfra/ext/class.rb
specinfra-2.70.1 lib/specinfra/ext/class.rb
specinfra-2.70.0 lib/specinfra/ext/class.rb
specinfra-2.69.0 lib/specinfra/ext/class.rb
specinfra-2.68.2 lib/specinfra/ext/class.rb
specinfra-2.68.1 lib/specinfra/ext/class.rb
specinfra-2.68.0 lib/specinfra/ext/class.rb
specinfra-2.67.10 lib/specinfra/ext/class.rb
specinfra-2.67.9 lib/specinfra/ext/class.rb
specinfra-2.67.8 lib/specinfra/ext/class.rb
specinfra-2.67.7 lib/specinfra/ext/class.rb
specinfra-2.67.6 lib/specinfra/ext/class.rb
specinfra-2.67.5 lib/specinfra/ext/class.rb
specinfra-2.67.3 lib/specinfra/ext/class.rb
specinfra-2.67.2 lib/specinfra/ext/class.rb
specinfra-2.67.1 lib/specinfra/ext/class.rb
specinfra-2.67.0 lib/specinfra/ext/class.rb
specinfra-2.66.9 lib/specinfra/ext/class.rb
specinfra-2.66.8 lib/specinfra/ext/class.rb
specinfra-2.66.7 lib/specinfra/ext/class.rb